Worksheet

an anonymous user · September 16, 2021 · SQL
CREATE TABLE BRANCH(
 brachNo
 street
 city
 postcode
);

CREATE TABLE STAFF(
 staffNo
 fName
 lName
 position
 sex
 DOB
 salary
 brachNo
 
);


CREATE TABLE PROPERTYFORRENT (
 propertyNo
 street
 city
 postcode
 type
 rooms
 rent
 ownerNo
 staffNo
 brachNo
);


CREATE TABLE CLIENT (
 clienNo
 fName
 lName
 telNo
 preftype
 maxrent
);


CREATE TABLE PRIVATEOWNER (
 ownerNo
 fName
 lName
 telNo
);


CREATE TABLE VİEWİNG (
 clientNo
 propertyNo
 viewDate
 comment

);


CREATE TABLE REGİSTRATİON (
 clientNo, 
 branchNo, 
 staffNo, 
 dateJoined

);



















-- create a table
CREATE TABLE students (
  id INTEGER PRIMARY KEY,
  name TEXT NOT NULL,
  gender TEXT NOT NULL
);
-- insert some values
INSERT INTO students VALUES (1, 'Ryan', 'M');
INSERT INTO students VALUES (2, 'Joanna', 'F');
-- fetch some values
SELECT * FROM students WHERE gender = 'F';

Comments

Please sign up or log in to contribute to the discussion.