Advertisements
Advertisements
Question
I. Write an SQL statement to create a table named STUDENTS, with the following specifications:
| Column Name | Data Type | Key |
| StudentID | Numeric | Primary Key |
| FirstName | Varchar(20) | |
| LastName | Varchar(10) | |
| DateOfBirth | Date | |
| Percentage | Float(10,2) |
II. Write SQL Query to insert the following data in the Students Table 1, Supriya, Singh, 2010-08-18, 75.5.
Code Writing
Advertisements
Solution
- CREATE TABLE STUDENTS (
StudentID NUMERIC PRIMARY KEY,
FirstName VARCHAR(20),
LastName VARCHAR(10),
DateOfBirth DATE,
Percentage FLOAT(10,2)
); - INSERT INTO STUDENTS (StudentID, FirstName, LastName, DateOfBirth, Percentage) VALUES (1, 'Supriya', 'Singh', '2010-08-18', 75.5);
shaalaa.com
Is there an error in this question or solution?
