DDL - Problem Description
DDL - Problem Description
DDL - Problem Description
2022
Submit your solutions in the SoftUni Judge system at Judge
100 Tourist Sites of Bulgaria is a Bulgarian national movement established in 1966 to promote tourism among
Bulgaria's most significant cultural, historic, and natural landmarks. You are given the task to create a database in
which you will store information about the sites and the tourists who are visiting them.
© SoftUni – about.softuni.bg. Copyrighted document. Unauthorized copy, reproduction or use is not permitted.
You have been tasked to create the tables in the database by the following models:
Categories
Column Name Data Type Constraints
Locations
Column Name Data Type Constraints
Sites
Column Name Data Type Constraints
Tourists
Column Name Data Type Constraints
© SoftUni – about.softuni.bg. Copyrighted document. Unauthorized copy, reproduction or use is not permitted.
SitesTourists
Column Name Data Type Constraints
BonusPrizes
Column Name Data Type Constraints
TouristsBonusPrizes
Column Name Data Type Constraints
© SoftUni – about.softuni.bg. Copyrighted document. Unauthorized copy, reproduction or use is not permitted.
2. Insert
Let's insert some sample data into the database. Write a query to add the following records into the corresponding
tables. All Ids should be auto-generated.
Tourists
Name Age PhoneNumber Nationality Reward
Borislava Kazakova 52 +359896354244 Bulgaria NULL
Peter Bosh 48 +447911844141 UK NULL
Martin Smith 29 +353863818592 Ireland Bronze badge
Svilen Dobrev 49 +359986584786 Bulgaria Silver badge
Kremena Popova 38 +359893298604 Bulgaria NULL
Sites
Name LocationId CategoryId Establishment
Ustra fortress 90 7 X
3. Upd
Karlanovo Pyramids 65 7 NULL ate
The Tomb of Tsar Sevt 63 8 V BC For some
Sinite Kamani Natural Park 17 1 NULL of the
St. Petka of Bulgaria – Rupite 92 6 1994 tourist
sites there are no clear records when they were established, so you need to update the column 'Establishment'
for those records by putting the text '(not defined)'.
4. Delete
For this year's raffle it was decided to remove the Sleeping bag from the bonus prizes.
© SoftUni – about.softuni.bg. Copyrighted document. Unauthorized copy, reproduction or use is not permitted.
Example
Name Age PhoneNumber Nationality
… … … …
Example
Site Location Establishment Category
House of Humour and Satire Museum – Gabrovo 1972 Spare time in the
Gabrovo city
… … …
© SoftUni – about.softuni.bg. Copyrighted document. Unauthorized copy, reproduction or use is not permitted.
Example
Province Municipality Location CountOfSites
Example
Site Location Municipality Province Establishment
Asen's Fortress Asenovgrad Asenovgrad Plovdiv V BC
National archaeological Yambol Yambol Yambol II BC
reserve Kabile
Perperikon – Medieval Rhodope NULL NULL V BC
Archaeological Complex Mountain
Shumen Fortress Historical- Shumen Shumen Shumen I BC
Archaeological Preserve
Starosel – Thracian Temple Starosel Hisarya Plovdiv V BC
Complex village
Thracian Tomb of Kazanlak Kazanlak Karlovo Plovdiv IV BC
© SoftUni – about.softuni.bg. Copyrighted document. Unauthorized copy, reproduction or use is not permitted.
Example
LastName Nationality Age PhoneNumber
Brown UK 42 +447459881347
… … … …
Examples
Query
© SoftUni – about.softuni.bg. Copyrighted document. Unauthorized copy, reproduction or use is not permitted.
Query
Output
Query
Output
Example
Query
Result
Name Reward
Example
Query
© SoftUni – about.softuni.bg. Copyrighted document. Unauthorized copy, reproduction or use is not permitted.
Example
Query
Result
Name Reward
Example
Query
Result
Name Reward
© SoftUni – about.softuni.bg. Copyrighted document. Unauthorized copy, reproduction or use is not permitted.