From the database scheme write the query(all tables are empty) 1) Insert your name and your phone as a new tenant 2) Delete your phone number from the table tenant. 3) Create a new contract lease for you. 4) Delete the contract that you created. 5) List the city name, city population and country name.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

From the database scheme write the query(all tables are empty)

1) Insert your name and your phone as a new tenant

2) Delete your phone number from the table tenant.

3) Create a new contract lease for you.

4) Delete the contract that you created.

5) List the city name, city population and country name.

6) List the cities that have the letters “re” in any part of the name;

7) List the tenant name contract number, rent price, when the contract rent price is bigger equal 500 and lower equal 1000.

8) List all columns from apartments with the services offered (all columns from service).

9) List the building address, the city name and the country name for the building in Canada.

10) List the name of the user with the city name and country name, ordering by name of user.

 

 
user
Tenant
userid INT
country
tenantid INT
? countryid INT(11)
username VARCHAR(50)
tenantName VARCHAR(45)
countryName VARCHAR(90)
password VARCHAR(255)
O tenantPhone VARCHAR (20)
name VARCHAR(45)
countryAbbreviation VARCHAR(3)
Indexes
Indexes
O email VARCHAR(45)
O birthday DATETIME
useratyid INT
City
OuserPrivilegeld INT(11)
cityld INT
Indexes
cityName VARCHAR(30)
cityPopulation DOUBLE
Contract
|Building
O city CountryId INT(11)
contractid INT
buildingid INT
Indexes
contractStartDate DATETIME
O buildingAddress VARCHAR(45)
O contractEndDate DATETIME
O buildingZipCode VARCHAR(7)
contractRentPrice DOUBLE
O buildingCityld INT
contracTenantid INT
Indexes
contracApartmentNumber INT
contracApartmentBuildingId INT
Indexes
Apartment
apartm entNumber INT
* apartm entBuilding Id INT
Service
O apartm entNumberRoom s DOUBLE
| ApartmentService
%23
serviceld INT
O apartm entRentPrice DOUBLE
apartm entServiceApartmentNum ber INT
serviceName VARCHAR(45)
Indexes
P apartm entServiceBuildingId INT
I apartmentServiceServiceld INT
Indexes
Indexes
Transcribed Image Text:user Tenant userid INT country tenantid INT ? countryid INT(11) username VARCHAR(50) tenantName VARCHAR(45) countryName VARCHAR(90) password VARCHAR(255) O tenantPhone VARCHAR (20) name VARCHAR(45) countryAbbreviation VARCHAR(3) Indexes Indexes O email VARCHAR(45) O birthday DATETIME useratyid INT City OuserPrivilegeld INT(11) cityld INT Indexes cityName VARCHAR(30) cityPopulation DOUBLE Contract |Building O city CountryId INT(11) contractid INT buildingid INT Indexes contractStartDate DATETIME O buildingAddress VARCHAR(45) O contractEndDate DATETIME O buildingZipCode VARCHAR(7) contractRentPrice DOUBLE O buildingCityld INT contracTenantid INT Indexes contracApartmentNumber INT contracApartmentBuildingId INT Indexes Apartment apartm entNumber INT * apartm entBuilding Id INT Service O apartm entNumberRoom s DOUBLE | ApartmentService %23 serviceld INT O apartm entRentPrice DOUBLE apartm entServiceApartmentNum ber INT serviceName VARCHAR(45) Indexes P apartm entServiceBuildingId INT I apartmentServiceServiceld INT Indexes Indexes
Expert Solution
steps

Step by step

Solved in 7 steps with 7 images

Blurred answer
Knowledge Booster
Basic sql queries
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education