Compare commits

..

No commits in common. "Laboratory_5-6" and "main" have entirely different histories.

6 changed files with 0 additions and 183 deletions

View File

@ -1,33 +0,0 @@
<?xml-stylesheet type="text/xml" href="library.xsl" version="2.0"?>
<book xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<row>
<bookid>1</bookid>
<genreid>1</genreid>
<title>Преступление и наказание</title>
<author>Ф.М.Достоевский</author>
</row>
<row>
<bookid>2</bookid>
<genreid>1</genreid>
<title>Мёртвые души</title>
<author>Н.В.Гоголь</author>
</row>
<row>
<bookid>3</bookid>
<genreid>2</genreid>
<title>Улитка на склоне</title>
<author>Братья Стругацкие</author>
</row>
<row>
<bookid>4</bookid>
<genreid>3</genreid>
<title>Любовь хулигана</title>
<author>С.А.Есенин</author>
</row>
</book>

View File

@ -1,23 +0,0 @@
<?xml-stylesheet type="text/xml" href="library.xsl" version="2.0"?>
<employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<row>
<employeeid>1</employeeid>
<genreid>3</genreid>
<fio>Иванов Иван Иванович</fio>
</row>
<row>
<employeeid>2</employeeid>
<genreid>2</genreid>
<fio>Медведев Евгений Юрьевич</fio>
</row>
<row>
<employeeid>3</employeeid>
<genreid>1</genreid>
<fio>Михайлова Юлия Вадимовна</fio>
</row>
</employee>

View File

@ -1,20 +0,0 @@
<?xml-stylesheet type="text/xml" href="library.xsl" version="2.0"?>
<genre xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<row>
<genreid>1</genreid>
<genrename>Классика</genrename>
</row>
<row>
<genreid>2</genreid>
<genrename>Научная фантастика</genrename>
</row>
<row>
<genreid>3</genreid>
<genrename>Поэзия</genrename>
</row>
</genre>

View File

@ -1,53 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h1 align="center">Library</h1>
<table border="3" align="center" >
<tr>
<th>ID жанра</th>
<th>Название жанра</th>
</tr>
<xsl:for-each select="genre/row">
<tr>
<td><xsl:value-of select="genreid"/></td>
<td><xsl:value-of select="genrename"/></td>
</tr>
</xsl:for-each>
</table>
<table border="3" align="center" >
<tr>
<th>ID сотрудника</th>
<th>ID жанра</th>
<th>ФИО</th>
</tr>
<xsl:for-each select="employee/row">
<tr>
<td><xsl:value-of select="employeeid"/></td>
<td><xsl:value-of select="genreid"/></td>
<td><xsl:value-of select="fio"/></td>
</tr>
</xsl:for-each>
</table>
<table border="3" align="center" >
<tr>
<th>ID книги</th>
<th>ID жанра</th>
<th>Название</th>
<th>Автор</th>
</tr>
<xsl:for-each select="book/row">
<tr>
<td><xsl:value-of select="bookid"/></td>
<td><xsl:value-of select="genreid"/></td>
<td><xsl:value-of select="title"/></td>
<td><xsl:value-of select="author"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,54 +0,0 @@
CREATE TABLE Genre (
GenreID INTEGER PRIMARY KEY,
GenreName varchar(30) NOT NULL
);
CREATE TABLE Employee (
EmployeeID int PRIMARY KEY,
GenreID INTEGER,
FIO varchar(50) NOT NULL,
FOREIGN KEY (GenreID) REFERENCES Genre (GenreID)
);
CREATE TABLE Book (
BookID INTEGER PRIMARY KEY,
GenreID INTEGER,
Title varchar(200) NOT NULL,
Author varchar(200) NOT NULL,
FOREIGN KEY (GenreID) REFERENCES Genre (GenreID)
);
INSERT INTO Genre VALUES
(1, 'Классика'),
(2, 'Научная фантастика'),
(3, 'Поэзия')
INSERT INTO Employee VALUES
(1, 3, 'Иванов Иван Иванович'),
(2, 2, 'Медведев Евгений Юрьевич'),
(3, 1, 'Михайлова Юлия Вадимовна')
INSERT INTO Book VALUES
(1, 1, 'Преступление и наказание', 'Ф.М.Достоевский'),
(2, 1, 'Мёртвые души', 'Н.В.Гоголь'),
(3, 2, 'Улитка на склоне', 'Братья Стругацкие'),
(4, 3, 'Любовь хулигана', 'С.А.Есенин')
COPY (SELECT table_to_xml('Genre', true, false, '')) to 'E:\MiAKD\Lab 5-6\genre.xml';
COPY (SELECT table_to_xml('Employee', true, false, '')) to 'E:\MiAKD\Lab 5-6\employee.xml';
COPY (SELECT table_to_xml('Book', true, false, '')) to 'E:\MiAKD\Lab 5-6\book.xml';
/* === Индексы (6 lab) === */
CREATE INDEX index_g
ON Genre (GenreID)
CREATE INDEX index_e
ON Employee (EmployeeID)
CREATE INDEX index_b
ON Book (BookID)

Binary file not shown.