4>
5> CREATE TABLE Candidates(
6> candname varchar(10) NOT NULL,
7> gender char(1) NOT NULL CONSTRAINT CHK_gender CHECK (gender IN('F', 'M'))
8> )
9> INSERT INTO Candidates VALUES('A', 'M')
10> INSERT INTO Candidates VALUES('B', 'M')
11> INSERT INTO Candidates VALUES('C', 'F')
12> INSERT INTO Candidates VALUES('D', 'F')
13>
14> SELECT
15> T1.candname,
16> T2.candname
17> FROM
18> Candidates AS T1
19> CROSS JOIN
20> Candidates AS T2
21> GO
(1 rows affected)
(1 rows affected)
(1 rows affected)
(1 rows affected)
candname candname
---------- ----------
A A
B A
C A
D A
A B
B B
C B
D B
A C
B C
C C
D C
A D
B D
C D
D D
(16 rows affected)
1>
2> drop table candidates
3> GO