SQL
SQL
SQL
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> INSERT INTO student VALUES(101, 'Rohit', 410); INSERT INTO student
VALUES(102, 'Mohit', 425); INSERT INTO student VALUES(103, 'Rahul', 475); INSERT
INTO student VALUES(104, 'Virat', 495);
Query OK, 1 row affected (0.00 sec)
+------------+-------+-------+
| student_id | name | marks |
+------------+-------+-------+
| 101 | Rohit | 410 |
| 102 | Mohit | 425 |
| 104 | Virat | 495 |
+------------+-------+-------+
3 rows in set (0.00 sec)
mysql> use q;
Database changed
mysql> create table orders;
ERROR 4028 (HY000): A table must have at least one visible column.
mysql> create table orders(orderid integer(5),customerid integer(5),orderdate(20));
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '(20))'
at line 1
mysql> create table orders(orderid integer(5),customerid integer(5),orderdate
varchar(20));
Query OK, 0 rows affected, 2 warnings (0.01 sec)
mysql> use q;
Database changed
mysql> show tables;
+-------------+
| Tables_in_q |
+-------------+
| customers |
| orders |
+-------------+
2 rows in set (0.00 sec)
mysql> use x;
Database changed
mysql> CREATE TABLE Customers (
-> customer_ID INT PRIMARY KEY,
-> customer_Name VARCHAR(100),
-> country VARCHAR(100)
-> );
Query OK, 0 rows affected (0.02 sec)
mysql>