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

Information Communication Technology: Find The SQL Coding For The Following Requirements and Execute Them On Your Laptop

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Information Communication Technology: Find The SQL Coding For The Following Requirements and Execute Them On Your Laptop

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

G.C.E.

Advanced Level – 2020 (Paper Class)


INFORMATION COMMUNICATION TECHNOLOGY

Tutorial 23 (Feb – 2)
Find the SQL coding for the following requirements and execute them on your Laptop.
my; oelafjk wjYH;d i`oyd SQL fla; ,shd tajd Tfns ,emafgdma mrs.Klfha MYSQL
u.ska l%shd;aul lrkak'

1. Consider the following table header of a Library database.


mqia;ld, o;a; iuqodhlg wh;a my; j.= YSrAI i<lkak'
Book
ISBN Title Price PubYear Author Publisher

Author
AuthId AuthName AuthTel

Publisher
PubId PubName PubAddress PubTel

i. Write SQL coding to design the above 3 tables using suitable data types in MySQL.
by; j.= 3 ,nd .ekSu i`oyd fla;hka ,shd olajkak'

ii. Insert the following records for each table.


by; tu tla tla j.= i`oyd my; olajd we;s frfldav we;=,;a lrkak'

Book
ISBN Title Price$ PubYear Author Publisher
7779990 Database Systems 35.00 2011 Stallings Mc Grills
9898980 Solar System 40.57 1997 David Riche Mc Grills
8889555 Windows 7 50.00 2008 Bill Gates Microsoft

Author
AuthId AuthName AuthEmail
900 Stallings stallings@gmail.com
679 David Riche d.riche@hotmail.com

Publisher
PubId PubName PubAddress PubTel
S34 Mc Grills 214, York Street, California 00970787000
G23 Red Balloons 339, Main street, Hong Kong 00882340000

© m%no
q aO Y%Sud,a - www.apepanthiya.lk 2020
my; iii' isg vii' olajd rEmfha olajd we;s mrsos o;a; iuqodh fjkialus i`oyd wod,
fla;hka ,shd olajkak'

iii. Book
ISBN Title Price$ PubYear Author
7779990 Database Systems 35.00 2011 Stallings
9898980 Solar System 40.57 1997 David Riche
8889555 Windows 7 50.00 2008 Bill Gates

Delete the column "Publisher"

iv. Book
ISBN Title Price$ PubYear Author
7779990 Database Systems 35.00 2011 Stallings
9898980 Solar System 40.57 1997 David Riche
8889555 Windows 8.1 50.00 2009 Bill Gates

v. Book
ISBN Title Price$ PubYear Author Medium
7779990 Database Systems 35.00 2011 Stallings NULL

9898980 Solar System 40.57 1997 David Riche NULL

8889555 Windows 8.1 50.00 2009 Bill Gates NULL

vi. Book
ISBN Title Price$ PubYear Author Medium
7779990 Database Systems 35.00 2011 Stallings English
9898980 Solar System 40.57 1997 David Riche French
8889555 Windows 8.1 50.00 2009 Bill Gates English

vii. Book
ISBN Title Price$ PubYear Author Medium
7779990 Database Systems 35.00 2011 Stallings English
9898980 Solar System 40.57 1997 David Riche English
8889555 Windows 8.1 50.00 2009 Bill Gates English

© m%no
q aO Y%Sud,a - www.apepanthiya.lk 2020
2. Consider the following table header of a Vehicle store.
jdyk .nvd o;a; iuqodhlg wh;a my; j.= YSrAIh i<lkak'

Vehicle
VID Make Model Year Type Color

i. Write SQL coding to design the above table using suitable data types in MySQL.
by; j.=j ,nd .ekSu i`oyd fla;hka ,shd olajkak'

ii. Insert the following records for each table.


by; tu tla tla j.= i`oyd my; olajd we;s frfldav we;=,;a lrkak'

Vehicle
VID Make Model Year Type Color
TY204 Toyota AE100 2001 Saloon NULL

HO433 Honda CRZ 2012 Sport NULL

BM004 BMW 520D 2015 Saloon NULL

my; iii' isg v' olajd rEmfha olajd we;s mrsos o;a; iuqodh fjkialus i`oyd wod,
fla;hka ,shd olajkak'

iii.

Vehicle
VID Make Model Year Type
TY204 Toyota Corolla 2008 Saloon
HO433 Honda CRZ 2012 Sport
BM004 BMW 520D 2015 Saloon

iv.

Vehicle
VID Make Model Year Type Price
TY204 Toyota Corolla 2008 Saloon
HO433 Honda CRZ 2012 Sport
BM004 BMW 520D 2015 Saloon

v.

Vehicle
VID Make Model Year Type Price
TY204 Toyota Corolla 2008 Saloon 8000000.00
HO433 Honda CRZ 2012 Sport 4500000.00
BM004 BMW 520D 2015 Saloon 12400000.00

© m%no
q aO Y%Sud,a - www.apepanthiya.lk 2020

You might also like