31. (i) Write the SQL statement to create a table, Customer with the following specifications:
Table: Customer| Column Name | Data Type | Key |
|---|---|---|
| CID | Int | Primary Key |
| FName | Varchar (20) | |
| LName | Varchar (20) | |
| Age | Int |
32. (a) Given the following tables:
| S_ID | NAME | AGE | CITY |
|---|---|---|---|
| 1 | Rahul | 20 | Delhi |
| 2 | Priya | 22 | Mumbai |
| 3 | David | 21 | Delhi |
| 4 | Neha | 23 | Bengaluru |
| 5 | Khurshid | 22 | Delhi |
| S_ID | SUBJECT | GRADE |
|---|---|---|
| 1 | Math | A |
| 2 | English | B |
| 3 | Math | C |
| 4 | English | A |
| 5 | Math | B |
Write SQL queries for the following:
(b) Consider the following tables:
Table 1: PRODUCTSThis table stores the basic details of the products available in a shop.
| PID | PName | Category |
|---|---|---|
| 201 | Laptop | Electronics |
| 202 | Chair | Furniture |
| 203 | Desk | Furniture |
| 204 | Smartphone | NULL |
| 205 | Tablet | Electronics |
This table records the number of units sold for each product.
| SaleID | PID | UnitsSold |
|---|---|---|
| 301 | 201 | 50 |
| 302 | 202 | 100 |
| 303 | 203 | 60 |
| 304 | 204 | 80 |
| 305 | 205 | 70 |
Write SQL queries for the following:
(b) Ashutosh, who is a manager, has created a database to manage employee records. The database includes a table named EMPLOYEE whose attribute names are mentioned below:
| EID | EMP_NAME | DEPT | SALARY | JOIN_DATE |
|---|---|---|---|---|
| E01 | ARJUN SINGH | SALES | 75000 | 2019-11-01 |
| E02 | PRIYA JAIN | ENGINEERING | 85000 | 2020-05-20 |
| E03 | RAVI SHARMA | MARKETING | 60000 | 2018-08-14 |
| E04 | AYESHA | NULL | 50000 | 2021-01-10 |
| E05 | RAHUL VERMA | FINANCE | 40000 | 2017-06-25 |
Write the output of the following SQL Queries:
34. (a) An educational institution is maintaining a database for storing the details of courses being offered. The database includes a table COURSE with the following attributes :
| C_ID | C_NAME | INSTRUCTOR | DURATION |
|---|---|---|---|
| C101 | Data Structures | Dr. Alok | 40 |
| C102 | Machine Learning | Prof. Sunita | 60 |
| C103 | Web Development | Ms. Sakshi | 45 |
| C104 | Database Management | Mr. Suresh | 50 |
| C105 | Python Programming | Dr. Pawan | 35 |
Write SQL queries for the following: