Осуществим подключение к бд
In [2]:
%load_ext sql
%sql sqlite:///lab_2.db
Out[2]:
In [ ]:
Создадим таблицу студентов, групп, городов и факультетов
In [3]:
%%sql
drop table if exists Students;
CREATE TABLE Students
(
student_id integer primary key,
Name varchar(50),
SecondName varchar(50),
Faculty_id integer,
city_id integer,
group_id integer
GPA number
);
drop table if exists Faculties;
CREATE TABLE Faculties
(
id integer primary key,
name varchar(50)
);
drop table if exists Groups;
Create table Groups
(
id integer primary key,
name varchar(50)
);
drop table if exists Cities;
Create table Cities
(
id integer primary key,
name varchar(50)
);
Out[3]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]: