Get the number, name, and date of birth of each player resident in Stratford; sort the result in alphabetical
order of name
mysql>
mysql> CREATE TABLE PLAYERS
-> (
-> PLAYERNO INTEGER NOT NULL,
-> NAME CHAR(15) NOT NULL,
-> INITIALS CHAR(3) NOT NULL,
-> BIRTH_DATE DATE ,
-> SEX CHAR(1) NOT NULL,
-> JOINED SMALLINT NOT NULL,
-> STREET VARCHAR(30) NOT NULL,
-> HOUSENO CHAR(4) ,
-> POSTCODE CHAR(6) ,
-> TOWN VARCHAR(30) NOT NULL,
-> PHONENO CHAR(13) ,
-> LEAGUENO CHAR(4) ,
-> PRIMARY KEY (PLAYERNO)
-> );
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql>
mysql> INSERT INTO PLAYERS VALUES(6, 'Parmenter', 'R', '1964-06-25', 'M', 1977,'Haseltine Lane', '80', '1234KK', 'Stratf
ord','070-476537', '8467');
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO PLAYERS VALUES(7, 'Wise', 'GWS', '1963-05-11', 'M', 1981,'Edgecombe Way', '39', '9758VB', 'Stratford'
,'070-347689', NULL);
Query OK, 1 row affected (0.00 sec)
mysql>
mysql>
mysql> SELECT PLAYERNO, NAME, BIRTH_DATE
-> FROM PLAYERS
-> WHERE TOWN = 'Stratford'
-> ORDER BY NAME;
+----------+-----------+------------+
| PLAYERNO | NAME | BIRTH_DATE |
+----------+-----------+------------+
| 6 | Parmenter | 1964-06-25 |
| 7 | Wise | 1963-05-11 |
+----------+-----------+------------+
2 rows in set (0.00 sec)
mysql>
mysql>
mysql> drop table players;
Query OK, 0 rows affected (0.00 sec)
mysql>
Related examples in the same category