Assume you have these table CREATE TABLE Student (studid Char(9) Primary Key, FirstName Varchar2(50) NOT NULL, LastName Varchar2(50) NOT NULL, Email Varchar2(50) NOT NULL UNIQUE, PhoneNumber Number(8) NOT NULL UNIQUE, DateOfBirth Date NOT NULL, GPA Number(1,2) NOT NULL); CREATE TABLE Club (clubID Number(3) Primary Key, ClubName Varchar2(20) NOT NULL, studid Char(9) NOT NULL UNIQUE, Foreign key(studid) references Student(studid)); CREATE TABLE MemberOf (ClubID Number(3) Primary Key, Studid char(9), JoiningDate date, Foreign Key(ClubID) references club(clubID), Foreign Key(Studid) references Student(studid)); CREATE TABLE Activities (Actid Number(3) Primary Key, Acdt DATE NOT NULL, Place Varchar2(50) NOT NULL, durationNbHour Number NOT NULL); CREATE TABLE Organize (actid Number(3) Primary Key, clubID Number(3), Fee Number(4,2), Foreign Key(actid) references Activities(Actid), Foreign Key(clubID) references MemberOf(ClubID)); Write in SQL queries to populate the above tables by inserting minimum 4 tuples in each one.
SQL
SQL stands for Structured Query Language, is a form of communication that uses queries structured in a specific format to store, manage & retrieve data from a relational database.
Queries
A query is a type of computer programming language that is used to retrieve data from a database. Databases are useful in a variety of ways. They enable the retrieval of records or parts of records, as well as the performance of various calculations prior to displaying the results. A search query is one type of query that many people perform several times per day. A search query is executed every time you use a search engine to find something. When you press the Enter key, the keywords are sent to the search engine, where they are processed by an algorithm that retrieves related results from the search index. Your query's results are displayed on a search engine results page, or SER.
Assume you have these table
CREATE TABLE Student (studid Char(9) Primary Key,
FirstName Varchar2(50) NOT NULL,
LastName Varchar2(50) NOT NULL,
Email Varchar2(50) NOT NULL UNIQUE,
PhoneNumber Number(8) NOT NULL UNIQUE,
DateOfBirth Date NOT NULL,
GPA Number(1,2) NOT NULL);
CREATE TABLE Club (clubID Number(3) Primary Key,
ClubName Varchar2(20) NOT NULL,
studid Char(9) NOT NULL UNIQUE, Foreign key(studid) references Student(studid));
CREATE TABLE MemberOf (ClubID Number(3) Primary Key,
Studid char(9),
JoiningDate date,
Foreign Key(ClubID) references club(clubID), Foreign Key(Studid) references Student(studid));
CREATE TABLE Activities (Actid Number(3) Primary Key,
Acdt DATE NOT NULL,
Place Varchar2(50) NOT NULL,
durationNbHour Number NOT NULL);
CREATE TABLE Organize (actid Number(3) Primary Key,
clubID Number(3),
Fee Number(4,2), Foreign Key(actid) references Activities(Actid),
Foreign Key(clubID) references MemberOf(ClubID));
Write in SQL queries to populate the above tables by inserting minimum 4 tuples in each one.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images