Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 22a4fed

Browse filesBrowse files
committed
Models & readme
1 parent 07f4f07 commit 22a4fed
Copy full SHA for 22a4fed

File tree

Expand file treeCollapse file tree

8 files changed

+36
-12
lines changed
Filter options
Expand file treeCollapse file tree

8 files changed

+36
-12
lines changed

‎BandsDB/BandsDB--ConceptualModel.png

Copy file name to clipboard
11.4 KB
Loading
File renamed without changes.

‎BandsDB/BandsDB--LogicModel.png

Copy file name to clipboard
18.9 KB
Loading

‎BandsDB/README.md

Copy file name to clipboard
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Conceptual model:
2+
![all-text](https://github.com/bispo-daniel/SQL_Scripts/blob/main/BandsDB/BandsDB--ConceptualModel.png)
3+
4+
# Logic model:
5+
![all-text](https://github.com/bispo-daniel/SQL_Scripts/blob/main/BandsDB/BandsDB--LogicModel.png)

‎PostsDB/PostsDB--DDL.sql

Copy file name to clipboardExpand all lines: PostsDB/PostsDB--DDL.sql
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CREATE DATABASE IF NOT EXISTS postsdb;
22
USE postsdb;
33

44
CREATE TABLE IF NOT EXISTS user (
5-
id int auto_increment primary key PRIMARY KEY,
5+
id int auto_increment primary key,
66
username varchar(100) not null unique,
77
password varchar(100) not null
88
);
@@ -11,6 +11,7 @@ CREATE TABLE IF NOT EXISTS user (
1111

1212
CREATE TABLE IF NOT EXISTS post (
1313
id int auto_increment primary key,
14+
posted datetime default current_timestamp,
1415
title varchar(100) not null,
1516
content text not null,
1617
fk_user_id int not null,

‎PostsDB/PostsDB--DML.sql

Copy file name to clipboard
+7-10Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
use postsdb;
22

3-
insert into user (id, username, password) values
4-
(1, '@bishop', '1234'),
5-
(2, '@data', '1234'),
6-
(3, '@bishop&co.', '1234');
3+
insert into user (username, password) values
4+
('@bishop', '1234'),
5+
('@data', '1234'),
6+
('@bishop&co.', '1234');
77

88
insert into post (title, content, fk_user_id) values
9-
('How...', 'Forget it... NEVERMIND!', 1),
10-
('How to...', 'Forget it... NEVERMIND!', 1),
11-
('How to...', 'Forget it... NEVERMIND!', 2),
12-
('How to do...', 'Forget it... NEVERMIND!', 2),
13-
('How to do...', 'Forget it... NEVERMIND!', 3),
14-
('How to do your', 'Forget it... NEVERMIND!', 3);
9+
('How to catch a butterfly', '[...] Just catch a look...', 1),
10+
('Lose weight following these simples steps!', 'Under development...', 2),
11+
('My favorite country from Europe is...', 'Shitzerland', 3);

‎PostsDB/PostsDB--DQL.sql

Copy file name to clipboard
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
use postsdb;
2-
select * from post;
2+
select * from post;
3+
select * from user;

‎RandomDataDB/RandomDataDB--DDL.sql

Copy file name to clipboard
+20Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
CREATE DATABASE IF NOT EXISTS randomdatadb;
2+
use randomdatadb;
3+
4+
CREATE TABLE IF NOT EXISTS randomData (
5+
id int auto_increment primary key,
6+
randomNumber bigint UNSIGNED not null,
7+
randomString longtext not null,
8+
randomDate date not null
9+
);
10+
11+
/*
12+
randomNumber limits: 0 - 18,446,744,073,709,551,615
13+
randomString limits: 4,294,967,295 characters
14+
randomDate limits: '1000-01-01' to '9999-12-31'
15+
*/
16+
17+
insert into randomData (randomNumber, randomString, randomDate)
18+
values (0, 'o', '1000-01-01');
19+
20+
select * from randomData;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.