-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
138 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
{\rtf1\ansi\ansicpg1252\cocoartf2639 | ||
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fnil\fcharset0 HelveticaNeue;\f1\fnil\fcharset0 HelveticaNeue-Bold;} | ||
{\colortbl;\red255\green255\blue255;\red34\green45\blue53;\red255\green255\blue255;} | ||
{\*\expandedcolortbl;;\cssrgb\c17647\c23137\c27059;\cssrgb\c100000\c100000\c100000;} | ||
\margl1440\margr1440\vieww28600\viewh15280\viewkind0 | ||
\deftab720 | ||
\pard\pardeftab720\sa240\partightenfactor0 | ||
|
||
\f0\fs32 \cf2 \cb3 \expnd0\expndtw0\kerning0 | ||
\outl0\strokewidth0 \strokec2 CREATE DATABASE NCT;\cb1 \uc0\u8232 \cb3 USE NCT;\ | ||
CREATE TABLE NCT127(\cb1 \uc0\u8232 \cb3 NCT_ID NUMERIC,\cb1 \uc0\u8232 \cb3 TotalMembers TINYINT,\cb1 \uc0\u8232 \cb3 DateFounded YEAR,\cb1 \uc0\u8232 \cb3 AgencyName TEXT,\cb1 \uc0\u8232 \cb3 FandomName TEXT,\cb1 \uc0\u8232 \cb3 FandomColor TEXT\cb1 \uc0\u8232 \cb3 );\ | ||
CREATE TABLE Member(\cb1 \uc0\u8232 \cb3 Member_ID NUMERIC,\cb1 \uc0\u8232 \cb3 FirstName VARCHAR(100),\cb1 \uc0\u8232 \cb3 LastName VARCHAR(100),\cb1 \uc0\u8232 \cb3 StageName TEXT,\cb1 \uc0\u8232 \cb3 Age TINYINT,\cb1 \uc0\u8232 \cb3 BirthDate DATE,\'a0\cb1 \uc0\u8232 \cb3 ZodiacSign TEXT,\cb1 \uc0\u8232 \cb3 RepEmoji TEXT,\cb1 \uc0\u8232 \cb3 Height TEXT,\cb1 \uc0\u8232 \cb3 Weight TEXT,\cb1 \uc0\u8232 \cb3 BloodType TEXT,\cb1 \uc0\u8232 \cb3 Nationality TEXT,\cb1 \uc0\u8232 \cb3 BirthPlace TEXT,\cb1 \uc0\u8232 \cb3 Education TEXT,\cb1 \uc0\u8232 \cb3 Description TEXT\cb1 \uc0\u8232 \cb3 );\ | ||
MariaDB [NCT]> SHOW TABLES;\ | ||
+---------------+\ | ||
| Tables_in_NCT |\ | ||
+---------------+\ | ||
| Member |\ | ||
| NCT127 |\ | ||
+---------------+\ | ||
\pard\pardeftab720\sa240\partightenfactor0 | ||
|
||
\f1\b \cf2 2 rows in set (0.000 sec) | ||
\f0\b0 \ | ||
INSERT INTO NCT127(NCT_ID, TotalMembers, DateFounded, AgencyName, FandomName, FandomColor)\'a0\cb1 \uc0\u8232 \cb3 \'a0 VALUES (1, 9, 2016, 'SM Entertainment', 'NCTzen', 'Lime Green');\cb1 \uc0\u8232 \cb3 \'a0\'a0\cb1 \uc0\u8232 \cb3 INSERT INTO Member(Member_ID, FirstName, LastName, StageName, Age, BirthDate, ZodiacSign, RepEmoji, Height, Weight, BloodType, Nationality, BirthPlace, Education, Description)\'a0\cb1 \uc0\u8232 \cb3 \'a0 VALUES (1, 'Tae-yong', 'Lee', 'Taeyong', 27, '1995-07-01', 'Cancer', 'Rose', '5\'929"', '128 lbs', 'O', 'South Korean', 'Seoul, South Korea', 'School of Performing Arts Seoul', 'Leader, Main Rapper, Sub-Vocalist, Main Dancer'),\cb1 \uc0\u8232 \cb3 \'a0 \'a0 \'a0 \'a0 \'a0(2, 'Mark', 'Lee', 'Mark', 23, '1999-08-02', 'Leo', 'Cheetah', '5\'929"', '134 lbs', 'A', 'Canadian', 'Toronto, Canada', 'School of Performing Arts Seoul', 'Main Rapper, Sub-Vocalist, Main Dancer'),\cb1 \uc0\u8232 \cb3 \'a0 \'a0 \'a0 \'a0 \'a0(3, 'Dong-hyuck', 'Lee', 'Haechan', 22, '2000-06-06', 'Gemini', 'Bear Face', '5\'929"', '123 lbs', 'AB', 'South Korean', 'Seoul, South Korea', 'School of Performing Arts Seoul', 'Main Vocalist, Lead Dancer, Maknae'),\cb1 \uc0\u8232 \cb3 \'a0 \'a0 \'a0 \'a0 \'a0(4, 'Dong-young', 'Kim', 'Doyoung', 26, '1996-02-01', 'Aquarius', 'Rabbit Face', '5\'9210"', '130 lbs', 'B', 'South Korean', 'Seoul, South Korea', 'Topyeong High School', 'Main Vocalist'),\cb1 \uc0\u8232 \cb3 \'a0 \'a0 \'a0 \'a0 \'a0(5, 'Jeong', 'Yun-o', 'Jaehyun', 25, '1997-02-14', 'Aquarius', 'Peach', '5\'9211"', '139 lbs', 'A', 'South Korean', 'Seoul, South Korea', 'School of Performing Arts Seoul', 'Main Vocalist, Lead Dancer, Sub-Rapper'),\cb1 \uc0\u8232 \cb3 \'a0 \'a0 \'a0 \'a0 \'a0(6, 'John', 'Suh', 'Johnny', 27, '1995-02-09', 'Aquarius', 'Cat Face', '6\'922"', '150 lbs', 'B', 'Korean-American', 'Chicago, Illinois', 'School of Performing Arts Seoul, Glennbrook North High School', 'Lead Dancer, Sub Rapper, Sub Vocalist'),\cb1 \uc0\u8232 \cb3 \'a0 \'a0 \'a0 \'a0 \'a0(7, 'Jung-woo', 'Kim', 'Jungwoo', 24, '1998-02-19', 'Pisces', 'Dog Face', '5\'9211"', '130 lbs', 'AB', 'South Korean', 'Seoul, South Korea', 'Gimpo Jeil Technical High School', 'Lead Vocalist, MC, Lead Dancer'),\cb1 \uc0\u8232 \cb3 \'a0 \'a0 \'a0 \'a0 \'a0(8, 'Yuta', 'Nakamoto', 'Yuta', 27, '1995-11-26', 'Scorpio', 'Octopus', '5\'929"', '130 lbs', 'A', 'Japanese', 'Kadoma, Osaka, Japan', 'Yashima Gakuen High School', 'Lead Dancer, Sub-Vocalist, Sub-Rapper'),\cb1 \uc0\u8232 \cb3 \'a0 \'a0 \'a0 \'a0 \'a0(9, 'Tae-il', 'Moon', 'Taeil', 28, '1994-06-14', 'Gemini', 'Full Moon', '5\'927"', '130 lbs', 'O', 'South Korean', 'Seoul, South Korea', 'Seoul Science High School', 'Main Vocalist');\ | ||
MariaDB [NCT]> SELECT * FROM NCT127;\ | ||
+--------+--------------+-------------+------------------+------------+-------------+\ | ||
| NCT_ID | TotalMembers | DateFounded | AgencyName\'a0 | FandomName | FandomColor |\ | ||
+--------+--------------+-------------+------------------+------------+-------------+\ | ||
| 1 | 9 | 2016 | SM Entertainment | NCTzen\'a0 | Lime Green |\ | ||
+--------+--------------+-------------+------------------+------------+-------------+\ | ||
|
||
\f1\b 1 row in set (0.000 sec) | ||
\f0\b0 \ | ||
MariaDB [NCT]> SELECT * FROM Member;\ | ||
+-----------+------------+----------+-----------+------+------------+------------+-------------+---------+---------+-----------+-----------------+----------------------+---------------------------------------------------------------+------------------------------------------------+\ | ||
| Member_ID | FirstName | LastName | StageName | Age | BirthDate | ZodiacSign | RepEmoji | Height | Weight | BloodType | Nationality\'a0 | BirthPlace\'a0 | Education\'a0 | Description |\ | ||
+-----------+------------+----------+-----------+------+------------+------------+-------------+---------+---------+-----------+-----------------+----------------------+---------------------------------------------------------------+------------------------------------------------+\ | ||
|\'a0 1 | Tae-yong\'a0 | Lee | Taeyong\'a0 |\'a0 27 | 1995-07-01 | Cancer\'a0 | Rose | 5\'929" | 128 lbs | O\'a0 | South Korean | Seoul, South Korea\'a0 | School of Performing Arts Seoul\'a0 | Leader, Main Rapper, Sub-Vocalist, Main Dancer |\ | ||
|\'a0 2 | Mark\'a0 | Lee | Mark |\'a0 23 | 1999-08-02 | Leo | Cheetah\'a0 | 5\'929" | 134 lbs | A\'a0 | Canadian | Toronto, Canada | School of Performing Arts Seoul\'a0 | Main Rapper, Sub-Vocalist, Main Dancer\'a0 |\ | ||
|\'a0 3 | Dong-hyuck | Lee | Haechan\'a0 |\'a0 22 | 2000-06-06 | Gemini\'a0 | Bear Face\'a0 | 5\'929" | 123 lbs | AB | South Korean | Seoul, South Korea\'a0 | School of Performing Arts Seoul\'a0 | Main Vocalist, Lead Dancer, Maknae\'a0 |\ | ||
|\'a0 4 | Dong-young | Kim | Doyoung\'a0 |\'a0 26 | 1996-02-01 | Aquarius\'a0 | Rabbit Face | 5\'9210"\'a0 | 130 lbs | B\'a0 | South Korean | Seoul, South Korea\'a0 | Topyeong High School | Main Vocalist |\ | ||
|\'a0 5 | Jeong | Yun-o | Jaehyun\'a0 |\'a0 25 | 1997-02-14 | Aquarius\'a0 | Peach\'a0 | 5\'9211"\'a0 | 139 lbs | A\'a0 | South Korean | Seoul, South Korea\'a0 | School of Performing Arts Seoul\'a0 | Main Vocalist, Lead Dancer, Sub-Rapper\'a0 |\ | ||
|\'a0 6 | John\'a0 | Suh | Johnny |\'a0 27 | 1995-02-09 | Aquarius\'a0 | Cat Face | 6\'922" | 150 lbs | B\'a0 | Korean-American | Chicago, Illinois | School of Performing Arts Seoul, Glennbrook North High School | Lead Dancer, Sub Rapper, Sub Vocalist |\ | ||
|\'a0 7 | Jung-woo\'a0 | Kim | Jungwoo\'a0 |\'a0 24 | 1998-02-19 | Pisces\'a0 | Dog Face | 5\'9211"\'a0 | 130 lbs | AB | South Korean | Seoul, South Korea\'a0 | Gimpo Jeil Technical High School | Lead Vocalist, MC, Lead Dancer\'a0 |\ | ||
|\'a0 8 | Yuta\'a0 | Nakamoto | Yuta |\'a0 27 | 1995-11-26 | Scorpio | Octopus\'a0 | 5\'929" | 130 lbs | A\'a0 | Japanese | Kadoma, Osaka, Japan | Yashima Gakuen High School | Lead Dancer, Sub-Vocalist, Sub-Rapper |\ | ||
|\'a0 9 | Tae-il\'a0 | Moon\'a0 | Taeil\'a0 |\'a0 28 | 1994-06-14 | Gemini\'a0 | Full Moon\'a0 | 5\'927" | 130 lbs | O\'a0 | South Korean | Seoul, South Korea\'a0 | Seoul Science High School\'a0 | Main Vocalist |\ | ||
+-----------+------------+----------+-----------+------+------------+------------+-------------+---------+---------+-----------+-----------------+----------------------+---------------------------------------------------------------+------------------------------------------------+\ | ||
|
||
\f1\b 9 rows in set (0.000 sec) | ||
\f0\b0 \ | ||
\'a0\ | ||
|
||
\f1\b 5 SQL SELECT Statements & Results | ||
\f0\b0 \ | ||
|
||
\f1\b 1) | ||
\f0\b0 \'a0SELECT StageName\'a0\cb1 \uc0\u8232 \cb3 \'a0 \'a0 FROM Member\'a0\cb1 \uc0\u8232 \cb3 \'a0 \'a0 WHERE StageName LIKE 'J%';\ | ||
MariaDB [NCT]> SELECT StageName\ | ||
-> FROM Member\ | ||
-> WHERE StageName LIKE 'J%';\ | ||
+-----------+\ | ||
| StageName |\ | ||
+-----------+\ | ||
| Jaehyun\'a0 |\ | ||
| Johnny |\ | ||
| Jungwoo\'a0 |\ | ||
+-----------+\ | ||
|
||
\f1\b 3 rows in set (0.000 sec) | ||
\f0\b0 \ | ||
\'a0\ | ||
|
||
\f1\b 2) | ||
\f0\b0 \'a0SELECT LastName, FirstName\'a0\cb1 \uc0\u8232 \cb3 \'a0 \'a0 FROM Member\cb1 \uc0\u8232 \cb3 \'a0 \'a0 ORDER BY LastName ASC;\ | ||
MariaDB [NCT]> SELECT LastName, FirstName\ | ||
-> FROM Member\ | ||
-> ORDER BY LastName ASC;\ | ||
+----------+------------+\ | ||
| LastName | FirstName |\ | ||
+----------+------------+\ | ||
| Kim | Dong-young |\ | ||
| Kim | Jung-woo\'a0 |\ | ||
| Lee | Tae-yong\'a0 |\ | ||
| Lee | Mark\'a0 |\ | ||
| Lee | Dong-hyuck |\ | ||
| Moon\'a0 | Tae-il\'a0 |\ | ||
| Nakamoto | Yuta\'a0 |\ | ||
| Suh | John\'a0 |\ | ||
| Yun-o | Jeong |\ | ||
+----------+------------+\ | ||
|
||
\f1\b 9 rows in set (0.000 sec) | ||
\f0\b0 \ | ||
\'a0\ | ||
3) SELECT COUNT(*)\'a0\cb1 \uc0\u8232 \cb3 \'a0 \'a0 FROM Member\cb1 \uc0\u8232 \cb3 \'a0 \'a0 WHERE Education LIKE 'School of Performing Arts Seoul';\ | ||
MariaDB [NCT]> SELECT COUNT(*)\'a0\ | ||
-> FROM Member\ | ||
-> WHERE Education LIKE 'School of Performing Arts Seoul';\ | ||
+----+\ | ||
| \'a0 |\ | ||
+----+\ | ||
| 4 |\ | ||
+----+\ | ||
|
||
\f1\b 1 row in set (0.000 sec) | ||
\f0\b0 \ | ||
\'a0\ | ||
|
||
\f1\b 4) | ||
\f0\b0 \'a0SELECT NCT127.AgencyName AS agency_name,\cb1 \uc0\u8232 \cb3 \'a0 \'a0 \'a0 \'a0 \'a0 \'a0 \'a0 \'a0 \'a0 \'a0Member.StageName AS stage_name\cb1 \uc0\u8232 \cb3 \'a0 \'a0 FROM NCT127\cb1 \uc0\u8232 \cb3 \'a0 \'a0JOIN Member ON NCT127.NCT_ID = Member.Member_ID;\ | ||
MariaDB [NCT]> SELECT NCT127.AgencyName AS agency_name,\ | ||
-> Member.StageName AS stage_name\ | ||
-> FROM NCT127\ | ||
-> JOIN Member ON NCT127.NCT_ID = Member.Member_ID;\ | ||
+------------------+------------+\ | ||
| agency_name | stage_name |\ | ||
+------------------+------------+\ | ||
| SM Entertainment | Taeyong |\ | ||
+------------------+------------+\ | ||
|
||
\f1\b 1 row in set (0.006 sec) | ||
\f0\b0 \ | ||
\'a0\ | ||
|
||
\f1\b 5) | ||
\f0\b0 \'a0SELECT StageName, BirthPlace\cb1 \uc0\u8232 \cb3 \'a0 \'a0 FROM Member\cb1 \uc0\u8232 \cb3 \'a0 \'a0 WHERE BirthPlace NOT LIKE 'S%a';\ | ||
MariaDB [NCT]> SELECT StageName, BirthPlace\ | ||
-> FROM Member\ | ||
-> WHERE BirthPlace NOT LIKE 'S%a';\ | ||
+-----------+----------------------+\ | ||
| StageName | BirthPlace\'a0 |\ | ||
+-----------+----------------------+\ | ||
| Mark | Toronto, Canada |\ | ||
| Johnny | Chicago, Illinois |\ | ||
| Yuta | Kadoma, Osaka, Japan |\ | ||
+-----------+----------------------+\ | ||
|
||
\f1\b 3 rows in set (0.000 sec)} |