0% found this document useful (0 votes)
57 views2 pages

Lab 8 Practice Manual 2017-CP

The document provides instructions for completing 7 tasks as part of a lab exercise on using structured query language (SQL) in Microsoft SQL Server. Students are asked to generate and populate tables to store data on Careem captains and cabs, then write SQL queries to analyze and retrieve information from the tables, such as showing the number of cabs by manufacturer, statistics on cabs by manufacturer, and details of a specific captain.

Uploaded by

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

Lab 8 Practice Manual 2017-CP

The document provides instructions for completing 7 tasks as part of a lab exercise on using structured query language (SQL) in Microsoft SQL Server. Students are asked to generate and populate tables to store data on Careem captains and cabs, then write SQL queries to analyze and retrieve information from the tables, such as showing the number of cabs by manufacturer, statistics on cabs by manufacturer, and details of a specific captain.

Uploaded by

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

DBMS Practice Manual, LAB 8

Class: 6th Semester (Computer-2017)

CLO 1 (Use of structured query language in Microsoft SQL server)


Instructions:
 It’s a practice manual and you should try it yourself. Kindly don’t copy others and concern
your previous lab manuals for help.
 Complete the tasks in this lab and submit the report to CR before the end of this Lab session.
CR will have to mail me before 11:59 AM today.
 Each Task should be answered using single SQL Query.

Task.1. Generate a table named as Careem_Captain having attributes and constraints given below.
Careem_Captain

Attributes Data Type Constraints


Capt_id Bigint PK, Not null
Name Varchar(30) Not null
Phone Bigint Unique

Task.2. Populate the above Table as:

Capt_id Name Phone


321021234567 Ali 03331234511
1
324061234567 Ahmad 03001234522
2
364061234567 Mohsin 03211234533
3
364061234567 Zaheer 03141234544
4

Task.3. Generate another table named as Careem_Cab having attributes and constraints given
below.
Careem_Cab
Attributes Data Type Constraints
Cab_No Varchar(8) PK, Not null
Manufacturer Varchar(10) Not null
Model Int Model shouldn’t be
under 2010.
Captain Bigint FK references Capt_id
of Careem_Captain,
Allow Nulls

Task.4. Populate the above Table as:

Cab_No Manufacturer Model Captain


LEE-4488 Honda 2018 3240612345672
MLL-9486 Suzuki 2012 3640612345673
DGM-303 Toyota 2015 3640612345674
LEC-3206 Suzuki 2016 3240612345672

Task.5. Show the number of Suzuki Manufactured Cabs registered by Careem.

Task.6. Show the statistics of Cabs registered with Careem w.r.t their Manufacturers.
Task.7. Show details of Careem Captain who owns the cab_no MLL-9486.

You might also like