0% found this document useful (0 votes)
8 views

Assignment 6 (SQL Queries)

Uploaded by

Raghav garg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Assignment 6 (SQL Queries)

Uploaded by

Raghav garg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Assignment - IP

1. Create a database with name “Mobile_world”.


2. Write MySql command to open the database.
3 .Create the table PREPAID in the database “Mobile_world” with following specification:
Field name Data type
Sno int 2
CName Varchar 20
Model Varchar 20
Connection Varchar 20
Activation_date date
Validity int 3
Amount int 4
4. Write the Sql query based on the data given in the following table „Prepaid‟
SNO CNAME Model Connection Activation_Date Validity Amount
(in days) (paid in Rs)
1 Sita Nokia Airtel 06-Apr-2004 365 3300
2 Ritesh Noika Hutch 02-Dec-2005 60 3030
3 Reena Samsung Hutch 14-May-2004 365 3030
4 Meetali Nokia Indicom 24-Sep-2004 180 890
5 Ramanuj Samaung Idea 16-Oct-2004 180 900
6 Anupam LG Hutch NULL 60 600
7 Sai Ram Nokia Indicom 10-Dec-2004 180 890
8 Deepa LG Reliance 08-Mar-2005 30 300
9 Karan Sony Idea 30-jan-2005 90 800
10 Jayant Sieman Airtel 02-Feb-2005 60 560

(i) Insert a new record in the above table with the following data:
11,‟Rita‟,‟Nokia‟,‟airtel‟,‟2009-04-06‟,365,3300
(ii) display all records from prepaid table.
(iii) display customer name, connection, model for all customers.
(iv) display the structure of table prepaid.
(v) display those customers whose connection is not Idea.
(vi) Display those connections whose validity is more than or equal to 50.
(vii) Write the output of following Queries:
(a) Select cname, validity from prepaid where amount>3000;
(b) Select model, validity from prepaid where validity=365;
(viii) To remove the table prepaid if it exist in database.
(ix) To remove the database mobile_world.
(x) what is the datatype of column activation_date.

You might also like