blob_id
stringlengths
40
40
language
stringclasses
1 value
repo_name
stringlengths
5
133
path
stringlengths
3
276
src_encoding
stringclasses
33 values
length_bytes
int64
23
9.61M
score
float64
2.52
5.28
int_score
int64
3
5
detected_licenses
listlengths
0
44
license_type
stringclasses
2 values
text
stringlengths
23
9.43M
download_success
bool
1 class
96d404b420a98935b24f261234ad94e693b74a21
SQL
PawelZu/mysql-scripts
/seo-zaplecza/add-tag_page-wpmu.sql
UTF-8
2,224
3.796875
4
[]
no_license
DROP PROCEDURE IF EXISTS add_tag_page_wpmu; DELIMITER // CREATE PROCEDURE add_tag_page_wpmu() BEGIN DECLARE done INT DEFAULT FALSE; DECLARE blogId INT; DECLARE blogPath VARCHAR(100); DECLARE blogDomain VARCHAR(100); declare tag_page_id int; DECLARE cur1 CURSOR FOR SELECT `blog_id`, `path`, `domain` FROM wp_blogs WHERE blog_id>1; /*DECLARE cur1 CURSOR FOR SELECT `blog_id`, `path`, `domain` FROM wp_blogs WHERE blog_id=109;*/ DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; OPEN cur1; read_loop: LOOP FETCH cur1 INTO blogId, blogPath, blogDomain; IF done THEN LEAVE read_loop; END IF; SET @CheckExists = 0; IF blogId=1 THEN SET @blogNumber = '_'; ELSE SET @blogNumber = CONCAT('_', CAST(blogId AS CHAR), '_'); END IF; set @posts_tab = concat('wp', @blogNumber, 'posts'); set @postMeta_tab = concat('wp', @blogNumber, 'postmeta'); SET @query = concat("SELECT count(*) INTO @CheckExists from ", @posts_tab, " where (post_name='tag' or post_name='tagi' or post_name LIKE 'tag-%') and post_type = 'page' and post_status = 'publish'"); PREPARE stmt FROM @query; EXECUTE stmt; DEALLOCATE PREPARE stmt; IF (@CheckExists < 1) THEN SET @sql_text = CONCAT('INSERT INTO ', @posts_tab, ' (post_author, post_title, post_status, comment_status, ping_status, post_name, post_type) VALUES(1, "Tag" ,"publish", "closed", "closed", "tag", "page")'); PREPARE stmt FROM @sql_text; EXECUTE stmt; DEALLOCATE PREPARE stmt; select LAST_INSERT_ID() into tag_page_id; SET @sql_text = CONCAT('UPDATE ', @posts_tab, ' SET guid="',blogDomain,blogPath,'?page_id=',tag_page_id,'" WHERE ID=', tag_page_id); PREPARE stmt FROM @sql_text; EXECUTE stmt; DEALLOCATE PREPARE stmt; SET @sql_text = CONCAT('INSERT INTO ', @postMeta_tab, ' (post_id, meta_key, meta_value) VALUES (', tag_page_id,', "_wp_page_template", "tags.php")'); PREPARE stmt FROM @sql_text; EXECUTE stmt; DEALLOCATE PREPARE stmt; select tag_page_id; /*select blogId, blogDomain, blogPath, 'nie ma';*/ /*else select blogPath, 'jest';*/ end if; END LOOP; CLOSE cur1; END // DELIMITER ;
true
9012145a6a046fdc110d1e74f059f09048b10f49
SQL
gustiyana/Kelompok4
/Tugas Besar/Database/javamarketdcc.sql
UTF-8
4,324
3.296875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 3.2.4 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jan 05, 2017 at 10:32 -- Server version: 5.1.41 -- PHP Version: 5.3.1 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `javamarketdcc` -- -- -------------------------------------------------------- -- -- Table structure for table `barang` -- CREATE TABLE IF NOT EXISTS `barang` ( `idbarang` int(11) NOT NULL AUTO_INCREMENT, `kdbarang` varchar(11) NOT NULL, `nmbarang` varchar(50) NOT NULL, `satuan` varchar(30) NOT NULL, `stok` int(4) NOT NULL, `harga` int(15) NOT NULL, PRIMARY KEY (`idbarang`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=17 ; -- -- Dumping data for table `barang` -- INSERT INTO `barang` (`idbarang`, `kdbarang`, `nmbarang`, `satuan`, `stok`, `harga`) VALUES (7, 'B-1', 'LCD Monitor', 'Pcs', 0, 5555), (9, 'B-2', 'Mouse', 'Pcs', 6, 25000), (13, 'B-4', 'Charger', 'Box', 10, 50000); -- -------------------------------------------------------- -- -- Table structure for table `beli` -- CREATE TABLE IF NOT EXISTS `beli` ( `idbeli` int(11) NOT NULL AUTO_INCREMENT, `nonota` varchar(20) NOT NULL, `tgl` date NOT NULL, `total` int(20) NOT NULL, `bayar` int(20) NOT NULL, `kembali` int(20) NOT NULL, PRIMARY KEY (`idbeli`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=51 ; -- -- Dumping data for table `beli` -- INSERT INTO `beli` (`idbeli`, `nonota`, `tgl`, `total`, `bayar`, `kembali`) VALUES (47, 'N-9', '2016-12-27', 5555, 10000, 4445), (48, 'N-10', '2016-12-27', 11110, 20000, 8890), (49, 'N-11', '2016-12-27', 25000, 30000, 5000), (50, 'N-12', '2016-12-27', 36110, 40000, 3890); -- -------------------------------------------------------- -- -- Table structure for table `detailbeli` -- CREATE TABLE IF NOT EXISTS `detailbeli` ( `nonota` varchar(20) NOT NULL, `kdbarang` varchar(20) NOT NULL, `nmbarang` varchar(50) NOT NULL, `harga` int(20) NOT NULL, `jml` int(5) NOT NULL, `total` int(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `detailbeli` -- INSERT INTO `detailbeli` (`nonota`, `kdbarang`, `nmbarang`, `harga`, `jml`, `total`) VALUES ('N-2', 'B-2', 'Mouse', 25000, 2, 50000), ('N-8', 'B-2', 'Mouse', 25000, 2, 50000), ('N-9', 'B-1', 'LCD Monitor', 5555, 1, 5555), ('N-10', 'B-1', 'LCD Monitor', 5555, 2, 11110), ('N-11', 'B-2', 'Mouse', 25000, 1, 25000), ('N-12', 'B-2', 'Mouse', 25000, 1, 25000), ('N-12', 'B-1', 'LCD Monitor', 5555, 2, 11110); -- -------------------------------------------------------- -- -- Table structure for table `kasir` -- CREATE TABLE IF NOT EXISTS `kasir` ( `id_kasir` char(8) NOT NULL, `nama_kasir` varchar(30) DEFAULT NULL, `username` varchar(20) DEFAULT NULL, `password` varchar(30) DEFAULT NULL, `alamat` varchar(30) DEFAULT NULL, PRIMARY KEY (`id_kasir`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `kasir` -- INSERT INTO `kasir` (`id_kasir`, `nama_kasir`, `username`, `password`, `alamat`) VALUES ('101', 'Disca Amelia', 'disca', 'disca', 'Kuningan'); -- -------------------------------------------------------- -- -- Table structure for table `pemasok` -- CREATE TABLE IF NOT EXISTS `pemasok` ( `id_pemasok` char(8) NOT NULL, `nama_pemasok` varchar(15) DEFAULT NULL, `alamat_pemasok` varchar(15) DEFAULT NULL, `no_telepon` int(11) DEFAULT NULL, `nama_barang` varchar(20) DEFAULT NULL, `jumlah_barang` int(11) DEFAULT NULL, PRIMARY KEY (`id_pemasok`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -- -- Dumping data for table `pemasok` -- INSERT INTO `pemasok` (`id_pemasok`, `nama_pemasok`, `alamat_pemasok`, `no_telepon`, `nama_barang`, `jumlah_barang`) VALUES ('101', 'Disca Amelia', 'Bandung', 2147483647, 'Komputer', 2), ('102', 'Meida Nilandari', 'Sukabumi', 2147483647, 'Magicom', 3), ('103', 'Inar Nilandari', 'Surabaya', 2147483647, 'Kipas Angin', 4); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
bdaff349ca5e39cb9059456064089bd5f8d8f26b
SQL
The-Software-Guild/sql-hotel-schema-kimberlyeslami
/KimberlyEslami-HotelData/KimberlyEslami-HotelData/kimberlyeslamihoteldb_reservations.sql
UTF-8
2,577
2.96875
3
[]
no_license
-- MySQL dump 10.13 Distrib 8.0.26, for Win64 (x86_64) -- -- Host: localhost Database: kimberlyeslamihoteldb -- ------------------------------------------------------ -- Server version 8.0.26 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!50503 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `reservations` -- DROP TABLE IF EXISTS `reservations`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; CREATE TABLE `reservations` ( `reservationId` int NOT NULL, `adults` varchar(45) NOT NULL, `children` varchar(45) DEFAULT NULL, `Guest_guestId` int NOT NULL, PRIMARY KEY (`reservationId`,`Guest_guestId`), KEY `fk_Reservations_Guest_idx` (`Guest_guestId`), CONSTRAINT `fk_Reservations_Guest` FOREIGN KEY (`Guest_guestId`) REFERENCES `guest` (`guestId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `reservations` -- LOCK TABLES `reservations` WRITE; /*!40000 ALTER TABLE `reservations` DISABLE KEYS */; INSERT INTO `reservations` VALUES (1,'1','0',2),(2,'2','1',3),(3,'2','0',4),(4,'2','2',5),(5,'1','1',1),(6,'3','0',6),(7,'2','2',7),(9,'1','0',9),(10,'1','1',10),(11,'2','4',11),(12,'2','0',12),(13,'1','0',12),(14,'3','0',6),(15,'2','0',1),(16,'3','1',9),(17,'4','2',10),(18,'2','1',3),(19,'1','0',3),(20,'2','0',2),(21,'2','2',5),(22,'2','2',4),(23,'2','0',2),(24,'2','2',2),(25,'2','0',11); /*!40000 ALTER TABLE `reservations` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2021-08-23 17:18:07
true
294928a38bc0a85e77bf0f57a9a4e516a0912d56
SQL
stukaloav/CService
/ContactService/src/main/resources/schema.sql
UTF-8
1,145
3.34375
3
[]
no_license
DROP TABLE IF EXISTS CONTACT; DROP TABLE IF EXISTS HOBBY; DROP TABLE IF EXISTS PLACE; DROP TABLE IF EXISTS CONTACT_HOBBIES; DROP TABLE IF EXISTS FRIENDSHIP; DROP TABLE IF EXISTS CONTACT_PLACES; DROP TABLE IF EXISTS MESSAGE; CREATE TABLE CONTACT ( ID INT NOT NULL AUTO_INCREMENT , FIRST_NAME VARCHAR(99) NOT NULL , LAST_NAME VARCHAR(99) NOT NULL , BIRTH_DATE DATE ); CREATE TABLE HOBBY ( ID INT NOT NULL AUTO_INCREMENT , TITLE VARCHAR(99) NOT NULL , DESCRIPTION VARCHAR(99) NOT NULL ); CREATE TABLE PLACE ( ID INT NOT NULL AUTO_INCREMENT , TITLE VARCHAR(99) NOT NULL , LONGITUDE DOUBLE NOT NULL , LATITUDE DOUBLE NOT NULL ); CREATE TABLE CONTACT_HOBBIES ( CONTACT_ID INT NOT NULL , HOBBY_ID INT NOT NULL ); CREATE TABLE FRIENDSHIP ( FIRST_CONTACT_ID INT NOT NULL , SECOND_CONTACT_ID INT NOT NULL ); CREATE TABLE CONTACT_PLACES ( CONTACT_ID INT NOT NULL , PLACE_ID INT NOT NULL ); CREATE TABLE MESSAGE( ID INT NOT NULL AUTO_INCREMENT, MESSAGE_DATE DATE, SENDER_ID INT NOT NULL, RECEIVER_ID INT NOT NULL, CONTENT VARCHAR(1000) NOT NULL );
true
f812a9fc23650dee721d20644027f2b224bc355d
SQL
anagh07/job_portal
/queries/db_create.sql
UTF-8
6,251
3.53125
4
[]
no_license
DROP DATABASE career_portal; CREATE database career_portal; USE career_portal; CREATE TABLE employer ( employer_ID int NOT NULL AUTO_INCREMENT, first_name varchar(50) NOT NULL, last_name varchar(50), emp_specialization varchar(100), country varchar(50), phone VARCHAR(50), email varchar(50) NOT NULL, regist_date DATE, login_name varchar(50), login_password varchar(50) NOT NULL, PRIMARY KEY (employer_ID) ); CREATE TABLE user ( user_ID int NOT NULL AUTO_INCREMENT, first_name varchar(50) NOT NULL, last_name varchar(50) NOT NULL, country varchar(50), phone varchar(50), email varchar(50) NOT NULL, interest varchar(50), skill varchar(50), current_employer varchar(50), graduation_date DATE, regist_date DATE, login_name varchar(50), login_password varchar(50) NOT NULL, PRIMARY KEY (user_ID) ); CREATE TABLE admin ( admin_ID int NOT NULL AUTO_INCREMENT, first_name varchar(50) NOT NULL, last_name varchar(50) NOT NULL, country varchar(50), phone varchar(50), email varchar(50), login_name varchar(50), login_password varchar(50), PRIMARY KEY (admin_ID) ); CREATE TABLE employer_category ( emp_category varchar(50) NOT NULL, charge INT, PRIMARY KEY (emp_category) ); CREATE TABLE user_category ( user_category varchar(50) NOT NULL, charge INT, PRIMARY KEY (user_category) ); CREATE TABLE job_category ( category_id INT NOT NULL AUTO_INCREMENT, category_name varchar(50), PRIMARY KEY (category_id) ); CREATE TABLE job_listing ( job_ID int NOT NULL AUTO_INCREMENT, job_title varchar(50) NOT NULL, job_description varchar(255) NOT NULL, no_of_vacancies varchar(50), post_date DATE, start_date DATE, salary INT, status varchar(50), category_id INT, company VARCHAR(255), PRIMARY KEY (job_ID), FOREIGN KEY (category_id) REFERENCES job_category(category_id) ); CREATE TABLE job_listing_history ( job_ID int NOT NULL, job_title varchar(50) NOT NULL, job_description varchar(50) NOT NULL, filling_date DATE, PRIMARY KEY (job_ID) ); CREATE TABLE job_offer ( job_ID int NOT NULL, salary int, offer_date DATE, deadline DATE, PRIMARY KEY (job_ID), FOREIGN KEY (job_ID) REFERENCES job_listing(job_ID) ON DELETE CASCADE ); CREATE TABLE account ( account_number int NOT NULL, balance int, manual_or_auto varchar(50), PRIMARY KEY (account_number) ); CREATE TABLE credit_card_account ( account_number int NOT NULL, card_number int, exp_date DATE, security_code int, PRIMARY KEY (account_number), FOREIGN KEY (account_number) REFERENCES account(account_number) ); CREATE TABLE checking_account ( account_number int NOT NULL, auth_number int, amount int, PRIMARY KEY (account_number), FOREIGN KEY (account_number) REFERENCES account(account_number) ); CREATE TABLE suffering_account ( account_number int NOT NULL, over_balance int, over_balance_date DATE, PRIMARY KEY (account_number), FOREIGN KEY (account_number) REFERENCES account(account_number) ); CREATE TABLE manual_payment ( payment_number int NOT NULL, payment_date DATE, PRIMARY KEY (payment_number) ); CREATE TABLE offers ( job_ID int NOT NULL, user_ID int NOT NULL, PRIMARY KEY (job_ID, user_ID), FOREIGN KEY (job_ID) REFERENCES job_offer(job_ID) ON DELETE CASCADE, FOREIGN KEY (user_ID) REFERENCES user(user_ID) ON DELETE CASCADE ); CREATE TABLE accepts ( job_ID int NOT NULL, user_ID int NOT NULL, PRIMARY KEY (job_ID, user_ID), FOREIGN KEY (job_ID) REFERENCES job_offer(job_ID) ON DELETE CASCADE, FOREIGN KEY (user_ID) REFERENCES user(user_ID) ON DELETE CASCADE ); CREATE TABLE rejects ( job_ID int NOT NULL, user_ID int NOT NULL, PRIMARY KEY (job_ID, user_ID), FOREIGN KEY (job_ID) REFERENCES job_offer(job_ID) ON DELETE CASCADE, FOREIGN KEY (user_ID) REFERENCES user(user_ID) ON DELETE CASCADE ); CREATE TABLE emp_categorized ( employer_ID int NOT NULL, emp_category varchar(50) NOT NULL, PRIMARY KEY (employer_ID), FOREIGN KEY (employer_ID) REFERENCES employer(employer_ID) ON DELETE CASCADE ); CREATE TABLE user_categorized ( user_ID int NOT NULL, user_category varchar(50) NOT NULL, PRIMARY KEY (user_ID), FOREIGN KEY (user_ID) REFERENCES user(user_ID) ON DELETE CASCADE ); CREATE TABLE posts ( job_ID int NOT NULL, employer_ID int NOT NULL, PRIMARY KEY (job_ID), FOREIGN KEY (job_ID) REFERENCES job_listing(job_ID) ON DELETE CASCADE, FOREIGN KEY (employer_ID) REFERENCES employer(employer_ID) ON DELETE CASCADE ); CREATE TABLE application ( job_ID int NOT NULL, user_ID int NOT NULL, application_date DATE, PRIMARY KEY (job_ID, user_ID), FOREIGN KEY (job_ID) REFERENCES job_listing(job_ID) ON DELETE CASCADE, FOREIGN KEY (user_ID) REFERENCES user(user_ID) ON DELETE CASCADE ); CREATE TABLE user_depositor ( account_number int NOT NULL, user_ID int NOT NULL, access_date DATE, payment_interval int, PRIMARY KEY (account_number), FOREIGN KEY (account_number) REFERENCES account(account_number) ON DELETE CASCADE, FOREIGN KEY (user_ID) REFERENCES user(user_ID) ON DELETE CASCADE ); CREATE TABLE employer_depositor ( account_number int NOT NULL, employer_ID int NOT NULL, access_date DATE, payment_interval int, PRIMARY KEY (account_number), FOREIGN KEY (account_number) REFERENCES account(account_number) ON DELETE CASCADE, FOREIGN KEY (employer_ID) REFERENCES employer(employer_ID) ON DELETE CASCADE ); CREATE TABLE pays ( payment_number int NOT NULL, account_number int NOT NULL, amount int, PRIMARY KEY (payment_number, account_number), FOREIGN KEY (payment_number) REFERENCES manual_payment(payment_number) ON DELETE CASCADE, FOREIGN KEY (account_number) REFERENCES account(account_number) ON DELETE CASCADE ); CREATE TABLE has_skills ( user_ID int NOT NULL, skill varchar(50), PRIMARY KEY (user_ID, skill), FOREIGN KEY (user_ID) REFERENCES user(user_ID) ON DELETE CASCADE );
true
fb6051e55d92afdd8f45160560ee875a2076ca1d
SQL
glensc/eventum
/upgrade/patches/04_isu_order.sql
UTF-8
196
2.625
3
[]
no_license
ALTER TABLE %TABLE_PREFIX%issue_user ADD isu_order int(11) NOT NULL DEFAULT '0' AFTER isu_assigned_date, ADD INDEX isu_order (isu_order); UPDATE %TABLE_PREFIX%issue_user set isu_order=isu_iss_id;
true
5d4de0aee07a705d535c0ef4a9eded6df8748182
SQL
apoorvakshirsagar12/Java-Web-Development
/StockAPIEclipse/SQL/mysql.sql
UTF-8
7,596
2.921875
3
[]
no_license
CREATE DATABASE IF NOT EXISTS `my_stock` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `my_stock`; -- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64) -- -- Host: localhost Database: my_stock -- ------------------------------------------------------ -- Server version 5.7.20-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `purchase` -- DROP TABLE IF EXISTS `purchase`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `purchase` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `uid` int(10) NOT NULL, `stock_symbol` varchar(20) NOT NULL, `qty` int(11) NOT NULL, `price` double NOT NULL, `amt` double NOT NULL, `date` timestamp NULL DEFAULT NULL, `action` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `purchase` -- LOCK TABLES `purchase` WRITE; /*!40000 ALTER TABLE `purchase` DISABLE KEYS */; INSERT INTO `purchase` VALUES (38,25,'AMZN',5,1179.14,5895.7,'2017-12-18 03:01:37','purchase'),(39,25,'FB',2,180.18,360.36,'2017-12-18 03:02:09','purchase'),(40,25,'AR',16,17.66,307.9904,'2017-12-18 03:06:33','purchase'),(41,26,'EBAY',15,38.37,575.55,'2017-12-18 03:16:44','purchase'),(42,26,'TWTR',10,22.22,222.2,'2017-12-18 03:17:03','purchase'),(43,26,'EBAY',9,38.37,345.33,'2017-12-18 03:17:49','sell'); /*!40000 ALTER TABLE `purchase` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `stock_requests_manager` -- DROP TABLE IF EXISTS `stock_requests_manager`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `stock_requests_manager` ( `req_id` int(11) NOT NULL AUTO_INCREMENT, `uid` int(11) DEFAULT NULL, `symbol` varchar(45) DEFAULT NULL, `price` double DEFAULT NULL, `amt` double DEFAULT NULL, `qty` int(11) DEFAULT NULL, `mgr_id` int(11) DEFAULT NULL, `date` timestamp NULL DEFAULT NULL, `type` varchar(45) DEFAULT NULL, `status` varchar(45) DEFAULT NULL, PRIMARY KEY (`req_id`) ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `stock_requests_manager` -- LOCK TABLES `stock_requests_manager` WRITE; /*!40000 ALTER TABLE `stock_requests_manager` DISABLE KEYS */; INSERT INTO `stock_requests_manager` VALUES (9,25,'AR',17.66,300,16,28,'2017-12-18 03:06:33','purchase','approved'),(10,25,'NA',NULL,200,0,28,NULL,'sell','pending'),(11,26,'NA',NULL,200,0,27,NULL,'purchase','pending'),(12,26,'EBAY',38.37,400,9,27,'2017-12-18 03:17:49','sell','approved'); /*!40000 ALTER TABLE `stock_requests_manager` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `tbl_user` -- DROP TABLE IF EXISTS `tbl_user`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `tbl_user` ( `user_id` int(11) DEFAULT NULL, `balance` double DEFAULT NULL, `date` timestamp NULL DEFAULT NULL, KEY `fk_userid_idx` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `tbl_user` -- LOCK TABLES `tbl_user` WRITE; /*!40000 ALTER TABLE `tbl_user` DISABLE KEYS */; INSERT INTO `tbl_user` VALUES (25,100000,'2017-12-18 02:58:39'),(26,100000,'2017-12-18 02:59:05'),(28,0,'2017-12-18 03:00:13'),(25,94104.3,'2017-12-18 03:01:37'),(25,93743.94,'2017-12-18 03:02:09'),(25,93435.9496,'2017-12-18 03:06:33'),(28,25.4304,'2017-12-18 03:06:33'),(27,0,'2017-12-18 03:15:04'),(26,99424.45,'2017-12-18 03:16:44'),(26,99202.25,'2017-12-18 03:17:03'),(26,99513.047,'2017-12-18 03:17:49'),(27,34.533,'2017-12-18 03:17:49'); /*!40000 ALTER TABLE `tbl_user` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `user_stock` -- DROP TABLE IF EXISTS `user_stock`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `user_stock` ( `uid` int(11) NOT NULL, `stock_symbol` varchar(45) DEFAULT NULL, `qty` int(10) DEFAULT NULL, KEY `fk_uid_idx` (`uid`), CONSTRAINT `fk_uid` FOREIGN KEY (`uid`) REFERENCES `users` (`U_Userid`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `user_stock` -- LOCK TABLES `user_stock` WRITE; /*!40000 ALTER TABLE `user_stock` DISABLE KEYS */; INSERT INTO `user_stock` VALUES (25,'AMZN',5),(25,'FB',2),(25,'AR',16),(26,'EBAY',6),(26,'TWTR',10); /*!40000 ALTER TABLE `user_stock` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `users` -- DROP TABLE IF EXISTS `users`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `users` ( `U_Userid` int(11) NOT NULL AUTO_INCREMENT, `U_UserName` varchar(45) DEFAULT NULL, `U_Password` varchar(45) DEFAULT NULL, `U_Role` varchar(45) DEFAULT NULL, `U_Status` varchar(45) DEFAULT NULL, `U_FirstName` varchar(45) DEFAULT NULL, `U_LastName` varchar(45) DEFAULT NULL, `U_Phone` varchar(45) DEFAULT NULL, `U_Address` varchar(45) DEFAULT NULL, `mgr_id` int(11) DEFAULT NULL, `mgt_fees` double DEFAULT NULL, `balance` double DEFAULT NULL, PRIMARY KEY (`U_Userid`) ) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `users` -- LOCK TABLES `users` WRITE; /*!40000 ALTER TABLE `users` DISABLE KEYS */; INSERT INTO `users` VALUES (1,'apoorva.12993@gmail.com','apoorva','admin','approved','Apoorva','Kshirsagar','5183132983','870,washington ave',0,0,0),(25,'ajoshi@gmail.com','akshay','user','approved','Akshay','Joshi','5182983123','730, Morris Street\r\nApt #2',28,0,93435.9496),(26,'diksha@gmail.com','diksha','user','approved','Diskha','Jaiswal','1234987634','Washington Avenue',27,0,99513.047),(27,'renu@gmail.com','renu','manager','approved','Renu','Bhingare','9423555083','Mumbai,India',0,10,34.533),(28,'anuja@gmail.com','anuja','manager','approved','Anuja','Kshirsagar','9423555093','Nashik,India',0,9,25.4304),(29,'abhishek@gmail.com','abhishek','manager','pending','Abhishek','Rai','1234512345','Western Avenue',0,14,0); /*!40000 ALTER TABLE `users` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2017-12-17 22:29:56
true
27b2dbb25ccc8398816c35b017df5a833ffd73c3
SQL
GuilhermeRodriguesSantos/Projeto-Integrador
/Paralelo/Script_paralelo_CREATE.sql
UTF-8
358
2.859375
3
[]
no_license
CREATE DATABASE teste; USE teste; CREATE TABLE tabela ( indice INT AUTO_INCREMENT PRIMARY KEY, nome_cnpj_endereco TEXT NOT NULL ); DELETE FROM tabela where id!=0; INSERT INTO tabela (nome_cnpj_endereco) VALUES ("Vitor Ribeiro|37324460852|Av Engenheiro Heitor Antonio|555"), ("Rita Ribeiro|1234567890|Itanhaem|123"), ("William Águiar|37324467267|Rua Bituva|107");
true
e7e730f63bf27e85271a900e563ee2def5631f89
SQL
CooperNolan/ArticleManager
/src/main/resources/articlemanagement.sql
UTF-8
3,467
3.875
4
[ "MIT" ]
permissive
create database articlemanagement character set utf8; use articlemanagement; CREATE TABLE users ( user_id int(11) NOT NULL AUTO_INCREMENT COMMENT '用户编号', username varchar(20) NOT NULL unique COMMENT '登录账号', userpass varchar(20) NOT NULL COMMENT '登录密码', nickname varchar(20) NOT NULL COMMENT '用户昵称', birthday varchar(30) DEFAULT NULL COMMENT '出生日期', gender varchar(3) DEFAULT NULL COMMENT '用户性别', phone varchar(13) DEFAULT NULL COMMENT '联系方式', email varchar(30) DEFAULT NULL COMMENT '邮箱', address varchar(30) DEFAULT NULL COMMENT '地址', createTime datetime NOT NULL COMMENT '创建时间', updateTime datetime DEFAULT NULL COMMENT '最后修改时间', lastLogin datetime DEFAULT NULL COMMENT '最后登录时间', user_status int(2) NOT NULL COMMENT '用户状态 0 正常 1 锁定 2管理员', remark text COMMENT '个人简介', PRIMARY KEY (user_id) ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; CREATE TABLE article ( article_id int(11) NOT NULL AUTO_INCREMENT COMMENT '文章编号', author_id int(11) NOT NULL COMMENT '作者编号', category_id int(11) NOT NULL COMMENT '分类编号', article_topic varchar(30) DEFAULT NULL COMMENT '文章题目', article_content text COMMENT '文章内容', article_date datetime NOT NULL COMMENT '创建时间', article_modify_date datetime NOT NULL COMMENT '最后一次修改时间时间', article_status int(2) NOT NULL COMMENT '文章状态 0 正常 1 违规', PRIMARY KEY (article_id) ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; CREATE TABLE reply ( reply_id int(11) NOT NULL AUTO_INCREMENT COMMENT '回复编号', reply_grade int(11) NOT NULL COMMENT '回复等级 0 留言 0以上指向被回复信息ID', article_id int(11) NOT NULL COMMENT '文章编号', users_id int(11) NOT NULL COMMENT '回复人编号', for_users_id int(11) NOT NULL COMMENT '被回复人编号', reply_content text NOT NULL COMMENT '回复内容', reply_date datetime NOT NULL COMMENT '回复时间', reply_status int(2) NOT NULL COMMENT '回复状态 0 正常 1 违规', PRIMARY KEY (reply_id) ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; CREATE TABLE category ( category_id int(11) NOT NULL AUTO_INCREMENT COMMENT '分类编号', category_name varchar(20) NOT NULL unique COMMENT '分类名称', category_date datetime NOT NULL COMMENT '分类添加时间', category_status int(2) NOT NULL COMMENT '分类状态 0 正常 1 违规', PRIMARY KEY (category_id) ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; ALTER TABLE article ADD FOREIGN KEY(author_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE article ADD FOREIGN KEY(category_id) REFERENCES category(category_id) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE reply ADD FOREIGN KEY(article_id) REFERENCES article(article_id) ON DELETE CASCADE ON UPDATE CASCADE; insert into users(username,userpass,nickname,createTime,user_status,remark) values('admin','admin','admin',NOW(),2,'超级管理员'); insert into category(category_name,category_date,category_status) values ('Default',NOW(),0); insert into category(category_name,category_date,category_status) values ('Java',NOW(),0); insert into category(category_name,category_date,category_status) values ('Python',NOW(),0); insert into category(category_name,category_date,category_status) values ('C++',NOW(),0);
true
22d3ff526dcefb8c17592349e875d9adec3e9807
SQL
albertomattos/SQL_gerais
/Kit lançado.sql
UTF-8
216
2.625
3
[]
no_license
select cod_pac, data_mov from famovcad, famovprd where famovcad.comanda = famovprd.comanda and codigo = "097785" and cod_pro = "000119" and tipo_pgto = "R" and data_mov >= "01/02/2006" order by famovprd.comanda desc
true
7448b19621ac41afd0244a5a44fae99f937867c2
SQL
fstanchese/corporativo
/corporativo/sql/Boleto/Boleto_qPesRef.sql
UTF-8
234
2.84375
3
[]
no_license
select Boleto.*, boleto_gnState(Boleto.Id,trunc(sysdate),'CONSIDERAR_QUITADO') as SITUACAO from Boleto where State_Base_Id <> 3000000000001 and Referencia = p_Boleto_Referencia and WPessoa_Sacado_Id = nvl( p_WPessoa_Id ,0)
true
044eb3a3abcfafe181aa0d8b1a1662e7fc135323
SQL
koskoha/Financial-Manager-JavaFX
/src/SQL/create.sql
UTF-8
954
3.234375
3
[]
no_license
CREATE TABLE IF NOT EXISTS USERS ( ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, NAME TEXT NOT NULL, PASSWORD CHAR(32) ); CREATE TABLE IF NOT EXISTS ACCOUNTS ( ACCOUNT_ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, BALLANCE INTEGER NOT NULL, DESCRIPTION TEXT NOT NULL, USER_NAME TEXT NOT NULL ); CREATE TABLE IF NOT EXISTS RECORDS ( RECORD_ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, DESCRIPTION TEXT NOT NULL, AMOUNT REAL NOT NULL, IS_PUT INT NOT NULL, CATEGORY_ID INT NOT NULL, ACCOUNT_ID INT NOT NULL, RECORD_DATE TEXT Not NULL ); CREATE TABLE IF NOT EXISTS CATEGORIES ( ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, NAME TEXT NOT NULL );
true
f1010c4861b7ecb74cff06ecb551707be5f1eaef
SQL
miyako/4d-tips-northwind-traders
/northwindtraders.com.4dbase/SQL/EmployeeTerritories/Table.sql
UTF-8
172
2.71875
3
[]
no_license
CREATE TABLE IF NOT EXISTS EmployeeTerritories ( [EmployeeID] INT32 NOT NULL AUTO_INCREMENT, [TerritoryID] VARCHAR(20) NOT NULL, PRIMARY KEY (EmployeeID, TerritoryID) );
true
f2e24e25f94062fafd89b3b466bf9b7cd4275189
SQL
green-fox-academy/LiviaNy
/Week-18/day-2/quiz-app.sql
UTF-8
5,147
2.96875
3
[]
no_license
CREATE TABLE questions ( id int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT, question varchar(255) NOT NULL ); INSERT INTO questions (id, question) VALUES (1, 'Who made bubblegum flavored brokkoli?'), (2, 'What colour the firt orange had?'), (3, 'Which one letter doesn`t appear in any U.S. state name?'), (4, 'How many words Scotland has fro "snow"?'), (5, 'How many calories a blue whale eat in one mouthful?'), (6, 'The current American flag was designed by who?'), (7, 'What was the "#" symbol originally called?'), (8, 'What pet Theodore Roosevelt had?'), (9, 'How long a griaffe tongue can be?'), (10, 'How much the inventor of the microwave appliance received for his discovery?'), (11, 'Who has more neck bones?'), (12, 'Why Europeand were scared of eating tomatoes when they were introduced??'); CREATE TABLE answers ( ID int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT, question_id int(11) NOT NULL, answer varchar(255) NOT NULL, is_correct tinyint(1) NOT NULL ); INSERT INTO answers (id, question_id, answer, is_correct) VALUES (1, 1, 'KFC', 0), (2, 1, 'McDonalds', 1), (3, 1, 'Gordon Ramsay', 0), (4, 1, 'no one', 0), (5, 2, 'Orange', 0), (6, 2, 'Red', 0), (7, 2, 'White', 0), (8, 2, 'Green', 1), (9, 3, 'X', 0), (10, 3, 'Q', 1), (11, 3, 'Z', 0), (12, 3, 'V', 0), (13, 4, '421', 1), (14, 4, '0', 0), (15, 4, '7', 0), (16, 4, '103', 0), (17, 5, 'Half million calories', 1), (18, 5, '0 calories', 0), (19, 5, '10 000 calories', 0), (20, 5, 'One million calories', 0), (21, 6, 'Dwight D. Eisenhower', 0), (22, 6, 'The Queen', 0), (23, 6, 'a school boy', 1), (24, 6, 'John F. Kennedy', 0), (25, 7, 'octothrope', 1), (26, 7, 'pound', 0), (27, 7, 'hashtag', 0), (28, 7, 'criss cross', 0), (29, 8, 'Tiger', 0), (30, 8, 'Cat', 0), (31, 8, 'Elephant', 0), (32, 8, 'Hyena', 1), (33, 9, '150cm', 0), (34, 9, '10cm', 0), (35, 9, '50cm', 1), (36, 9, '1m', 0), (37, 10, '2 $', 1), (38, 10, '1 million $', 0), (39, 10, '0 $', 0), (40, 10, '1 billion $', 0), (41, 11, 'Giraffe', 0), (42, 11, 'Sloth', 1), (43, 11, 'Elephant', 0), (44, 11, 'Lama', 0), (45, 12, 'It was green', 0), (46, 12, 'They thought it`s a flower', 0), (47, 12, 'They had no such a problem', 0), (48, 12, 'They thought it`s poisoned', 1); CREATE TABLE comments ( id int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT, question_id int(11) NOT NULL, comment varchar(255) NOT NULL ); INSERT INTO comments (id, question_id, comment) VALUES (1, 1, 'This interesting fact will have your taste buds crawling. Unsurprisingly, the attempt to get kids to eat healthier didn’t go over well with the child testers, who were “confused by the taste”.'), (2, 2, 'The original oranges from Southeast Asia were a tangerine-pomelo hybrid, and they were actually green. In fact, oranges in warmer regions like Vietnam and Thailand still stay green through maturity.'), (3, 3, 'You’ll find a Z (Arizona), a J (New Jersey), and even two X’s (New Mexico and Texas)—but not a single Q.'), (4, 4, 'Yes—421! That’s too many fun facts about snow. Some examples: sneesl (to start raining or snowing); feefle (to swirl); flinkdrinkin (a light snow).'), (5, 5, 'These random facts are mindblowing! Those 457,000 calories are more than 240 times the energy the whale uses to scoop those krill into its mouth.'), (6, 6, 'It started as a school project for Bob Heft’s junior-year history class, and it only earned a B- in 1958. His design had 50 stars even though Alaska and Hawaii weren’t states yet. Heft figured the two would earn statehood soon and showed the government his design. After President Dwight D. Eisenhower called to say his design was approved, Heft’s teacher changed his grade to an A.'), (7, 7, 'Its technical name is octothorpe. The “octo-” means “eight” to refer to its points, though reports disagree on where “-thorpe” came from. Some claim it was named after Olympian Jim Thorpe, while others argue it was just a nonsense suffix.'), (8, 8, 'Its name was Bill and was a present from the Ethiopian emperor. Roosevelt was famous for his many pets, including a one-legged rooster, a badger, a pony, and a small bear.'), (9, 9, 'Their dark bluish black color is probably to prevent sunburn.'), (10, 10, 'Percy Spencer was working as a researcher for American Appliance Company (now Raytheon) when he noticed a radar set using electromagnetic waves melted the candy bar in his pocket. He had the idea to make a metal box using microwaves to heat food, but the company was the one to file the patent. He received a $2 bonus but never any royalties. '), (11, 11, 'Despite physical length, there are more bones in the neck of a sloth than a giraffe. There are seven vertebrae in the neck of giraffes, and in most mammals, but there are ten in a sloth. Still, giraffes are among 23 of the world’s biggest living animals.'), (12, 12, 'Scholars think Hernán Cortés brought the seeds in 1519 with the intent of the fruits being used ornamentally in gardens. By the 1700s, aristocrats started eating tomatoes, but they were convinced the fruits were poison because people would die after eating them. In reality, the acidity from the tomatoes brought out lead in their pewter plates, so they’d died of lead poisoning.');
true
e41990efc5b8330ec85f690e0a119cf4462edf55
SQL
gidor/dxfetl
/sql/no_condotte.sql
UTF-8
2,600
3.875
4
[]
no_license
SELECT INI.X AS "X", INI.Y AS "Y", FIN.X AS "X1", FIN.Y AS "Y1", ((INI.Z - (INI.FONTUBO / 100)) - (FIN.Z - (FIN.FONTUBO / 100))) as "DH", INI.OBJECTID & '-' & FIN.OBJECTID AS "OBJ_ID", INI.ISTAT_ID as "ISTAT_ID", INI.CODE as "CODE", INI.OBJECTID as "IDPUNINI", FIN.OBJECTID as "IDPUNFIN", '' as "IDLININI", INI.MATLIN as "MATLIN", INI.FORMSEZ as "FORSEZ", INI.ALT_LIN as "ALT_LIN", INI.LARGH_LIN as "LARG_LIN", (INI.Z - (INI.FONTUBO / 100)) as "QUOINI", (FIN.Z - (FIN.FONTUBO / 100)) as "QUOFIN", INI.FONTUBO as "DISLINI", FIN.FONTUBO as "DISLFIN", INI.TIPFOG as "TIPFOG", INI.TIPLINIDR as "TIPLINIDR", INI.POS_TRATTA as "POS_TRATTA", INI.POS_SUP as "POS_SUP", INI.FOTOINT as "IMAGE", INI.[DATA] as "DATA", INI.TNOTE as "NOTE", INI.TLUNG as "LUNG", INI.PENDENZA as "PENDENZA", INI.DEN_TRONCO as "DEN_TRONC", TL.[VAL] as "LAYER", M.MAT & ' ' & FS.[VAL] & INI.ALT_LIN & 'x' & INI.LARGH_LIN as "SECONDARY" FROM ((((((TUBI AS INI ) INNER JOIN L_MAT AS M ON (INI.`MATLIN` = M.`ID`) ) INNER JOIN TLAYERS AS TL ON (INI.`TIPFOG` = TL.`COD`) ) INNER JOIN TFORSEZ AS FS ON (INI.`FORMSEZ` = FS.`COD`) ) INNER JOIN TUBI_REL AS SE ON (SE.`INI` = INI.`ID`) ) INNER JOIN TUBI AS FIN ON (SE.`FIN` = FIN.`ID`) ) WHERE INI.FORMSEZ <> '02'; SELECT INI.X AS "X", INI.Y AS "Y", FIN.X AS "X1", FIN.Y AS "Y1", ((INI.Z - (INI.FONTUBO / 100)) - (FIN.Z - (FIN.FONTUBO / 100))) as "DH", INI.OBJECTID & '-' & FIN.OBJECTID AS "OBJ_ID", INI.ISTAT_ID as "ISTAT_ID", INI.CODE as "CODE", INI.OBJECTID as "IDPUNINI", FIN.OBJECTID as "IDPUNFIN", '' as "IDLININI", INI.MATLIN as "MATLIN", INI.FORMSEZ as "FORSEZ", INI.ALT_LIN as "ALT_LIN", INI.LARGH_LIN as "LARG_LIN", (INI.Z - (INI.FONTUBO / 100)) as "QUOINI", (FIN.Z - (FIN.FONTUBO / 100)) as "QUOFIN", INI.FONTUBO as "DISLINI", FIN.FONTUBO as "DISLFIN", INI.TIPFOG as "TIPFOG", INI.TIPLINIDR as "TIPLINIDR", INI.POS_TRATTA as "POS_TRATTA", INI.POS_SUP as "POS_SUP", INI.FOTOINT as "IMAGE", INI.[DATA] as "DATA", INI.TNOTE as "NOTE", INI.TLUNG as "LUNG", INI.PENDENZA as "PENDENZA", INI.DEN_TRONCO as "DEN_TRONC", TL.[VAL] as "LAYER", M.MAT & ' ' & FS.[VAL] & INI.ALT_LIN as "SECONDARY" FROM ((((((TUBI AS INI ) INNER JOIN L_MAT AS M ON (INI.`MATLIN` = M.`ID`) ) INNER JOIN TLAYERS AS TL ON (INI.`TIPFOG` = TL.`COD`) ) INNER JOIN TFORSEZ AS FS ON (INI.`FORMSEZ` = FS.`COD`) ) INNER JOIN TUBI_REL AS SE ON (SE.`INI` = INI.`ID`) ) INNER JOIN TUBI AS FIN ON (SE.`FIN` = FIN.`ID`) ) WHERE INI.FORMSEZ = '02';
true
06be5a99d373f6772d7673859e6406b7b598cf5f
SQL
SharrarKhan/Pursuit-Core-Web-Unit-3-Assessment
/db/seed.sql
UTF-8
1,968
3.65625
4
[]
no_license
DROP DATABASE IF EXISTS seed; CREATE DATABASE seed; \c seed; CREATE TABLE researchers ( id SERIAL PRIMARY KEY, researchers_name VARCHAR, job_title VARCHAR ); CREATE TABLE species ( id SERIAL PRIMARY KEY, species_name VARCHAR, is_mammal BOOLEAN ); CREATE TABLE animals ( id SERIAL PRIMARY KEY, species_id INT REFERENCES species (id), nickname VARCHAR ); CREATE TABLE habitats ( id SERIAL PRIMARY KEY, catergory VARCHAR ); CREATE TABLE sightings ( id SERIAL PRIMARY KEY, researcher_id INT REFERENCES researchers (id) ON DELETE SET NULL, species_id INT REFERENCES species (id), habitat_id INT REFERENCES habitats ); INSERT INTO researchers(researchers_name, job_title) VALUES ('Mariana Aleta', 'Project Lead'), ('Javed', 'Senior Field Researcher'), ('Carolina', 'Field Researcher'), ('Jazmyn', 'Field Researcher'), ('Ezra', 'Research Intern') ; INSERT INTO species(species_name, is_mammal) VALUES ('Dolphin', true), ('Moral Eel', false), ('Tiger Shark', false), ('Orca Whale', true), ('Moon Jelly', false) ; INSERT INTO animals(species_id, nickname) VALUES (1, 'Flip'), (1, 'Skip'), (2, 'Jenkins'), (3, 'Sally'), (5, 'Flapjack'), (5, 'Gibbous'), (5, 'Nox') ; -- FROM TOP TO BOTTOM OF ANIMALS INPUTS -- Dolphin -- Dolphin -- Moray El -- Tiger Shark -- Moon Jelly -- Moon Jelly -- Moon Jelly INSERT INTO habitats(catergory) VALUES ('Shallows'), ('Coral Reef'), ('Tide Pools'), ('Deeps') ; INSERT INTO sightings(species_id, researcher_id, habitat_id) VALUES (4, 4, 4), (3, 1, 4), (5, 3, 3), (2, 5, 2), (1, 2, 1), (2, 5, 1) ; -- FROM TOP TO BOTTOM OF SIGHTINGS INPUTS -- An Orca Whale was spotted by Jazmyn Gottfried in the Deeps. -- A Tiger Shark was spotted by Mariana Aleta in the Deeps. -- A Moon Jelly was spotted by Carolina Itai in the Tide Pools. -- A Moray Eel was spotted by Ezra Flip in the Coral Reef. -- A Dolphin was spotted by Javed Patrick in the Shallows. -- A Moray Eel was spotted by Ezra Flip in the Shallows.
true
56ba783631432553716291cf72aa0d92cd7b92a8
SQL
Flavia-OlSi/SENAI-Segundo.Semestre
/SENAI-Sprint.1-BD/Desafio - RPG/hroads_01_DML.sql
ISO-8859-1
1,566
3.28125
3
[]
no_license
-- Selecionando o banco de dados USE SENAI_HROADS_MANHA; -- Inserindo dados na tabela Tipo INSERT INTO TiposDeHabilidades (Nome) VALUES ('Ataque'), ('Defesa'), ('Cura'), ('Magia'); -- Inserindo dados na tabela Habilidades INSERT INTO Habilidades (Nome, idTipoDeHabilidade) VALUES ('Lana Mortal', 1), ('Escudo Supremo', 2), ('Recuperar Vida', 3); -- Inserindo dados na tabela Classes INSERT INTO Classes (Nome) VALUES ('Brbaro'), ('Cruzado'), ('Caadora de demnios'), ('Monge'), ('Necromante'), ('Feiticeiro'), ('Arcanista'); -- Inserindo dados na tabela ClasseHabilidade INSERT INTO ClasseHabilidade (idClasse, idHabilidades) VALUES (1, 1), (1, 2), (2, 2), (3, 1), (4, 2), (4, 3), (6, 3); -- Inserindo dados na tabela TiposDeUsuarios INSERT INTO TiposDeUsuarios (Nome) VALUES ('Administrador'), ('Jogador'); -- Inserindo dados na tabela Usuarios INSERT INTO -- Inserindo dados na tabela Personagens INSERT INTO Personagens (Nome, [Capacidade maxima Vida], [Capacidade maxima Mana], [Data de Atualizao], [Data de criao], idClasse) VALUES ('DeuBug', 100, 80, '01/03/2021', '18/01/2019', 1), ('BitBug', 70, 100, '01/03/2021', '17/03/2016', 4), ('Fer8', 75, 60, '01/03/2021', '18/03/2019', 7); -- Atualizando o nome do personagem UPDATE Personagens SET Nome = 'Fer7' WHERE idPersonagem = 3; -- Atualizando o nome da classe UPDATE Classes SET Nome = 'Necromancer' WHERE idClasse = 5;
true
49caaac79feb8538f6ecab298bb32dde548140bf
SQL
bhupendpatil/Practice
/Database/PL SQL/activeDatabase.sql
UTF-8
2,723
4.21875
4
[ "MIT" ]
permissive
-- Active Database -- Create table bunty(eno;ename;hrs;pno;super_no) -- Create table kantekar(pname;pno;thrs;head_no) -- Insert 5 tuples and write triggers to do the following: -- a)Creating a trigger to insert new employee tuple and display the new total hours from project table. -- b)Creating a trigger to change the hrs of existing employee and display the new total hours from project table. -- c)Creating a trigger to change the project of an employee and display the new total hours from project table. -- d)Creating a trigger to delete the project of an employee. -- Create table bunty(eno;ename;hrs;pno;super_no) create table bunty( eno number(8) primary key, ename varchar(20), hrs number(8), pno number(8), super_no number(8)CONSTRAINT sup0225 UNIQUE ); -- Insert Values insert into bunty values(1,'Pooja',7,10,1001); insert into bunty values(2,'Priya',5,20,1002); insert into bunty values(3,'Radha',3,10,1003); insert into bunty values(4,'Nilam',1,20,1004); insert into bunty values(5,'Supriya',5,30,1005); -- Create table kantekar(pname;pno;thrs;head_no) create table katekar( pno number(8) primary key, pname varchar(20), thrs number(8), super_no number(8) CONSTRAINT supfk0225 references bunty(super_no) ); -- Insert Values insert into katekar values(10,'VB',10,1001); insert into katekar values(20,'JAVA',6,1002); insert into katekar values(30,'sORACLE',5,1005); -- Insert 5 tuples and write triggers to do the following: -- a)Creating a trigger to insert new employee tuple and display the new total hours from project table. create or replace Trigger QBT after insert on bunty for each row when(New.pno IS NOT NULL) begin update katekar set thrs=thrs+:New.hrs where pno=:New.pno; end; / insert into bunty values(6,'Suhas',4,30,1006); -- b)Creating a trigger to change the hrs of existing employee and display the new total hours from project table. create or replace Trigger QBV after update of hrs on bunty for each row when(New.pno IS NOT NULL) begin update katekar set thrs=thrs+:New.hrs-:old.hrs where pno=:New.pno; end; / update bunty set hrs = 10 where eno = 1; -- c)Creating a trigger to change the project of an employee and display the new total hours from project table. create or replace Trigger QB3 after update of pno on bunty for each row when(New.pno IS NOT NULL) begin update katekar set thrs=thrs+:New.hrs-:old.hrs where pno=:New.pno; end; / update bunty set pno=10 where eno=2; -- d)Creating a trigger to delete the project of an employee. create Trigger QB4u after delete on bunty for each row when(OLD.pno IS NOT NULL) begin update katekar set thrs=thrs-:Old.hrs where pno=:Old.pno; end; / delete from bunty where pno=20;
true
4d16653e192ad67f35f6d1bbba0a31144c2073b8
SQL
dongguiyan/android
/book/Book/src/main/webapp/db/book.sql
UTF-8
14,504
3.15625
3
[]
no_license
/* Navicat MySQL Data Transfer Source Server : MySQL Source Server Version : 50528 Source Host : localhost:3306 Source Database : mcy_book Target Server Type : MYSQL Target Server Version : 50528 File Encoding : 65001 Date: 2019-09-20 14:03:16 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for book -- ---------------------------- DROP TABLE IF EXISTS `book`; CREATE TABLE `book` ( `id` int(11) NOT NULL AUTO_INCREMENT, `author` varchar(255) DEFAULT NULL, `filename` varchar(255) DEFAULT NULL, `isbn` varchar(64) DEFAULT NULL, `loan_number` int(11) DEFAULT NULL, `name` varchar(255) DEFAULT NULL, `number` int(11) DEFAULT NULL, `press` varchar(255) DEFAULT NULL, `uuid` varchar(255) DEFAULT NULL, `kind_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `UK_ehpdfjpu1jm3hijhj4mm0hx9h` (`isbn`), KEY `FKt3jo8988fcydhfq87cdhqb44m` (`kind_id`), CONSTRAINT `FKt3jo8988fcydhfq87cdhqb44m` FOREIGN KEY (`kind_id`) REFERENCES `kind` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of book -- ---------------------------- INSERT INTO `book` VALUES ('1', '克里斯托弗·斯坦纳 ', 'QQ图片20190920125745.jpg', '123456', '1', '算法帝国', '2', '长江出版社', '992be331-b7bc-4d4d-bb45-9342e418f43f', '1'); INSERT INTO `book` VALUES ('2', '张三', 'QQ图片20190920125751.jpg', '111111', '0', 'c语言', '5', '清华出版社', '7b4f3948-84bf-4635-bd8a-b458fb089e03', '2'); INSERT INTO `book` VALUES ('3', '李四', 'QQ图片20190920125755.jpg', '222222', '1', '人工智能', '4', '长江出版社', '4f78bede-e773-478c-bdee-fa50123dc161', '1'); INSERT INTO `book` VALUES ('4', '张三', 'QQ图片20190920125758.jpg', '12345645', '1', '设计模式', '2', '长江出版社', '0dcfa5c1-e533-49f0-bc45-f36001b69841', '1'); INSERT INTO `book` VALUES ('5', 'admin', 'QQ图片20190920125801.jpg', '456', '0', '计算机', '5', '未来出版社', '661c6a80-d92d-4e4c-98cc-d6604e37e4e8', '2'); INSERT INTO `book` VALUES ('6', '1234', 'QQ图片20190920125804.jpg', '1234131', '0', 'ps', '23', '长江', '04ab4e26-8dab-406e-815a-005dcc826f46', '1'); INSERT INTO `book` VALUES ('7', '·123', 'QQ图片20190920125810.jpg', '123123', '0', 'Python', '5', '长江', 'dbf8af84-0055-4f36-b188-71d9e445bd05', '1'); -- ---------------------------- -- Table structure for dept -- ---------------------------- DROP TABLE IF EXISTS `dept`; CREATE TABLE `dept` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(64) DEFAULT NULL, `dept_id` int(11) DEFAULT NULL, `teacher_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `UK_ao06wunawb79tv8k153deuffs` (`name`), KEY `FK5bwmuwbv32l2bg3b9ia7dbj9p` (`dept_id`), KEY `FKe7uuxj9ix1ek5yaq1fp4rg8tv` (`teacher_id`), CONSTRAINT `FK5bwmuwbv32l2bg3b9ia7dbj9p` FOREIGN KEY (`dept_id`) REFERENCES `dept` (`id`), CONSTRAINT `FKe7uuxj9ix1ek5yaq1fp4rg8tv` FOREIGN KEY (`teacher_id`) REFERENCES `teacher` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of dept -- ---------------------------- INSERT INTO `dept` VALUES ('1', '某某大学', null, '3'); INSERT INTO `dept` VALUES ('2', '电子信息学院', '1', '3'); INSERT INTO `dept` VALUES ('3', '软件一班', '2', '3'); INSERT INTO `dept` VALUES ('4', '经济管理学院', '1', '3'); INSERT INTO `dept` VALUES ('5', '会计一班', '4', '3'); -- ---------------------------- -- Table structure for journal -- ---------------------------- DROP TABLE IF EXISTS `journal`; CREATE TABLE `journal` ( `id` int(11) NOT NULL AUTO_INCREMENT, `operation_name` varchar(255) DEFAULT NULL, `reamark` varchar(255) DEFAULT NULL, `time` varchar(255) DEFAULT NULL, `username` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of journal -- ---------------------------- INSERT INTO `journal` VALUES ('1', '登录', '系统管理员', '2019-05-21 18:23:06', 'system'); INSERT INTO `journal` VALUES ('2', '退出', '系统管理员', '2019-05-21 18:23:19', 'system'); INSERT INTO `journal` VALUES ('3', '登录', '图书管理员', '2019-05-21 18:23:27', 'admin'); INSERT INTO `journal` VALUES ('4', '添加老师', '图书管理员', '2019-05-21 18:25:18', 'admin'); INSERT INTO `journal` VALUES ('5', '添加学院或班级', '图书管理员', '2019-05-21 18:25:37', 'admin'); INSERT INTO `journal` VALUES ('6', '添加学院或班级', '图书管理员', '2019-05-21 18:25:48', 'admin'); INSERT INTO `journal` VALUES ('7', '添加学院或班级', '图书管理员', '2019-05-21 18:26:10', 'admin'); INSERT INTO `journal` VALUES ('8', '添加学院或班级', '图书管理员', '2019-05-21 18:26:21', 'admin'); INSERT INTO `journal` VALUES ('9', '添加学院或班级', '图书管理员', '2019-05-21 18:34:29', 'admin'); INSERT INTO `journal` VALUES ('10', '登录', '系统管理员', '2019-09-20 12:51:48', 'system'); INSERT INTO `journal` VALUES ('11', '退出', '系统管理员', '2019-09-20 12:52:18', 'system'); INSERT INTO `journal` VALUES ('12', '登录', '系统管理员', '2019-09-20 12:52:29', 'system'); INSERT INTO `journal` VALUES ('13', '退出', '系统管理员', '2019-09-20 12:52:37', 'system'); INSERT INTO `journal` VALUES ('14', '登录', '图书管理员', '2019-09-20 12:52:44', 'admin'); INSERT INTO `journal` VALUES ('15', '添加图书种类', '图书管理员', '2019-09-20 12:53:01', 'admin'); INSERT INTO `journal` VALUES ('16', '添加图书种类', '图书管理员', '2019-09-20 12:53:07', 'admin'); INSERT INTO `journal` VALUES ('17', '添加图书', '图书管理员', '2019-09-20 12:59:36', 'admin'); INSERT INTO `journal` VALUES ('18', '添加图书', '图书管理员', '2019-09-20 13:00:26', 'admin'); INSERT INTO `journal` VALUES ('19', '添加图书', '图书管理员', '2019-09-20 13:01:10', 'admin'); INSERT INTO `journal` VALUES ('20', '添加学生', '图书管理员', '2019-09-20 13:02:45', 'admin'); INSERT INTO `journal` VALUES ('21', '添加学生', '图书管理员', '2019-09-20 13:02:59', 'admin'); INSERT INTO `journal` VALUES ('22', '添加学生', '图书管理员', '2019-09-20 13:03:21', 'admin'); INSERT INTO `journal` VALUES ('23', '添加图书', '图书管理员', '2019-09-20 13:03:52', 'admin'); INSERT INTO `journal` VALUES ('24', '添加图书', '图书管理员', '2019-09-20 13:04:23', 'admin'); INSERT INTO `journal` VALUES ('25', '添加图书', '图书管理员', '2019-09-20 13:04:52', 'admin'); INSERT INTO `journal` VALUES ('26', '添加图书', '图书管理员', '2019-09-20 13:05:14', 'admin'); INSERT INTO `journal` VALUES ('27', '退出', '图书管理员', '2019-09-20 13:09:24', 'admin'); INSERT INTO `journal` VALUES ('28', '登录', '用户', '2019-09-20 13:09:48', '123'); INSERT INTO `journal` VALUES ('29', '退出', '用户', '2019-09-20 13:10:11', '123'); INSERT INTO `journal` VALUES ('30', '登录', '图书管理员', '2019-09-20 13:10:21', 'admin'); INSERT INTO `journal` VALUES ('31', '退出', '图书管理员', '2019-09-20 13:24:20', 'admin'); INSERT INTO `journal` VALUES ('32', '登录', '图书管理员', '2019-09-20 13:24:56', 'admin'); INSERT INTO `journal` VALUES ('33', '退出', '图书管理员', '2019-09-20 13:30:36', 'admin'); INSERT INTO `journal` VALUES ('34', '登录', '系统管理员', '2019-09-20 13:30:46', 'system'); INSERT INTO `journal` VALUES ('35', '退出', '系统管理员', '2019-09-20 13:34:35', 'system'); INSERT INTO `journal` VALUES ('36', '登录', '图书管理员', '2019-09-20 13:35:22', 'admin'); INSERT INTO `journal` VALUES ('37', '退出', '图书管理员', '2019-09-20 13:37:04', 'admin'); INSERT INTO `journal` VALUES ('38', '登录', '用户', '2019-09-20 13:37:10', '123'); -- ---------------------------- -- Table structure for kind -- ---------------------------- DROP TABLE IF EXISTS `kind`; CREATE TABLE `kind` ( `id` int(11) NOT NULL AUTO_INCREMENT, `number` int(11) DEFAULT NULL, `type` varchar(64) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `UK_nkmto30tewosx0blmj8fteqqj` (`type`) ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of kind -- ---------------------------- INSERT INTO `kind` VALUES ('1', '39', '计算机类'); INSERT INTO `kind` VALUES ('2', '10', '艺术类'); -- ---------------------------- -- Table structure for records -- ---------------------------- DROP TABLE IF EXISTS `records`; CREATE TABLE `records` ( `id` int(11) NOT NULL AUTO_INCREMENT, `end_time` varchar(255) DEFAULT NULL, `reamark` varchar(255) DEFAULT NULL, `return_time` varchar(255) DEFAULT NULL, `start_time` varchar(255) DEFAULT NULL, `state` varchar(255) DEFAULT NULL, `book_id` int(11) DEFAULT NULL, `user_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `FKtn0iin8slxpqpos9r97qwsoa7` (`book_id`), KEY `FK3tg2gh1akmkwwbx8hor9txfr9` (`user_id`), CONSTRAINT `FK3tg2gh1akmkwwbx8hor9txfr9` FOREIGN KEY (`user_id`) REFERENCES `sys_user` (`id`), CONSTRAINT `FKtn0iin8slxpqpos9r97qwsoa7` FOREIGN KEY (`book_id`) REFERENCES `book` (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of records -- ---------------------------- INSERT INTO `records` VALUES ('1', '2019-11-20 13:05:22', '图书管理员', null, '2019-09-20 13:05:22', '未还', '1', '2'); INSERT INTO `records` VALUES ('2', '2019-11-20 13:09:57', '用户', null, '2019-09-20 13:09:57', '未还', '4', '4'); INSERT INTO `records` VALUES ('3', '2019-11-20 13:10:00', '用户', null, '2019-09-20 13:10:00', '待审核', '3', '4'); -- ---------------------------- -- Table structure for student -- ---------------------------- DROP TABLE IF EXISTS `student`; CREATE TABLE `student` ( `phone` varchar(255) DEFAULT NULL, `sex` varchar(255) DEFAULT NULL, `id` int(11) NOT NULL, `dept_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `FK51vi5k0vbdvve6mrxlme8x0vo` (`dept_id`), CONSTRAINT `FK51vi5k0vbdvve6mrxlme8x0vo` FOREIGN KEY (`dept_id`) REFERENCES `dept` (`id`), CONSTRAINT `FKt1enxfujglcm8pio0xa8qbty5` FOREIGN KEY (`id`) REFERENCES `sys_user` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of student -- ---------------------------- INSERT INTO `student` VALUES ('123456', '男', '4', '3'); INSERT INTO `student` VALUES ('1111', '男', '5', '3'); INSERT INTO `student` VALUES ('123145', '男', '6', '5'); -- ---------------------------- -- Table structure for sys_admin -- ---------------------------- DROP TABLE IF EXISTS `sys_admin`; CREATE TABLE `sys_admin` ( `remark` varchar(255) DEFAULT NULL, `id` int(11) NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `FKs0p52er5hge04dv8bdb67rii3` FOREIGN KEY (`id`) REFERENCES `sys_user` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of sys_admin -- ---------------------------- INSERT INTO `sys_admin` VALUES (null, '2'); -- ---------------------------- -- Table structure for sys_role -- ---------------------------- DROP TABLE IF EXISTS `sys_role`; CREATE TABLE `sys_role` ( `id` int(11) NOT NULL AUTO_INCREMENT, `code` varchar(255) DEFAULT NULL, `name` varchar(20) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of sys_role -- ---------------------------- INSERT INTO `sys_role` VALUES ('1', 'ROLE_SYSTEM', '系统管理员'); INSERT INTO `sys_role` VALUES ('2', 'ROLE_ADMIN', '图书管理员'); INSERT INTO `sys_role` VALUES ('3', 'ROLE_USER', '学生'); INSERT INTO `sys_role` VALUES ('4', 'ROLE_TEACHER', '老师'); -- ---------------------------- -- Table structure for sys_user -- ---------------------------- DROP TABLE IF EXISTS `sys_user`; CREATE TABLE `sys_user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(20) DEFAULT NULL, `number` int(11) DEFAULT NULL, `password` varchar(100) DEFAULT NULL, `username` varchar(20) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `UK_51bvuyvihefoh4kp5syh2jpi4` (`username`) ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of sys_user -- ---------------------------- INSERT INTO `sys_user` VALUES ('1', '系统管理员', '0', '$2a$10$l3QL.WdVpFHTdXGxulWc2.OQEKJBjA35eDnZsVmxLtFtWPlQ4eSo2', 'system'); INSERT INTO `sys_user` VALUES ('2', '图书管理员', '1', '$2a$10$RXiC6sUiq44rLksuAunOZ.Z0tebJlNz614Xr7Dst0HLrcE9iGA6ta', 'admin'); INSERT INTO `sys_user` VALUES ('3', '张三', '0', '$2a$10$ONgTg.n7.KGiiF778Hcunu7RWInQPBUO4SELXyzOjcUi2wrY.YfGi', '123455'); INSERT INTO `sys_user` VALUES ('4', '张三', '2', '$2a$10$NG73eVcStccBLlcLOBHp6excP3sj21zLJBlpIsbRnCuwKMojg3jzq', '123'); INSERT INTO `sys_user` VALUES ('5', '李四', '0', '$2a$10$0E1k1JkYxGXgxsR3gLoVSexoIFZEDJkNb50ij2CJYRP2xtik26VIe', '123456'); INSERT INTO `sys_user` VALUES ('6', '张三', '0', '$2a$10$mfMfSn2TGx82jcMct0C/Yuo40x7YJEKR7sWBtxmMPQkCgLmFVjMme', '122341132'); -- ---------------------------- -- Table structure for sys_user_role -- ---------------------------- DROP TABLE IF EXISTS `sys_user_role`; CREATE TABLE `sys_user_role` ( `user_id` int(11) NOT NULL, `role_id` int(11) NOT NULL, KEY `FKhh52n8vd4ny9ff4x9fb8v65qx` (`role_id`), KEY `FKb40xxfch70f5qnyfw8yme1n1s` (`user_id`), CONSTRAINT `FKb40xxfch70f5qnyfw8yme1n1s` FOREIGN KEY (`user_id`) REFERENCES `sys_user` (`id`), CONSTRAINT `FKhh52n8vd4ny9ff4x9fb8v65qx` FOREIGN KEY (`role_id`) REFERENCES `sys_role` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of sys_user_role -- ---------------------------- INSERT INTO `sys_user_role` VALUES ('1', '1'); INSERT INTO `sys_user_role` VALUES ('2', '2'); INSERT INTO `sys_user_role` VALUES ('3', '4'); INSERT INTO `sys_user_role` VALUES ('4', '3'); INSERT INTO `sys_user_role` VALUES ('5', '3'); INSERT INTO `sys_user_role` VALUES ('6', '3'); -- ---------------------------- -- Table structure for teacher -- ---------------------------- DROP TABLE IF EXISTS `teacher`; CREATE TABLE `teacher` ( `remark` varchar(255) DEFAULT NULL, `id` int(11) NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `FKf133j4v6w5thwqt8shi88o0ic` FOREIGN KEY (`id`) REFERENCES `sys_user` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of teacher -- ---------------------------- INSERT INTO `teacher` VALUES ('asdf', '3');
true
5e13c3d2171aa78c15e3dea619d47b8446697baa
SQL
myunghakLee/PC_Post_System
/Seat Schema&Data.sql
UTF-8
960
2.59375
3
[]
no_license
CREATE SCHEMA IF NOT EXISTS `SEAT` DEFAULT CHARACTER SET utf8 ; use Seat; -- ----------------------------------------------------- -- Table `Seat` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `Seat`.`Seat` ( `Seat_ID` INT NOT NULL, `IS_empty` INT NOT NULL, `reamain_time` Time, PRIMARY KEY (`Seat_ID`)) ENGINE = InnoDB; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; insert into Seat values (1,0,"11:30:00"), (2,0,"01:30:00"), (3,1,NULL), (4,1,NULL), (5,1,NULL), (6,1,NULL), (7,0,"11:30:00"), (8,0,"7:30:00"), (9,0,"5:00:00"), (10,1,NULL), (11,1,NULL), (12,1,NULL), (13,1,NULL), (14,0,"1:27:00"), (15,0,"3:13:00"), (16,0,"4:22:00"), (17,0,"0:30:00"), (18,0,"0:27:00"), (19,1,NULL), (20,1,NULL), (21,1,NULL), (22,1,NULL), (23,1,NULL), (24,0,"3:29:00"), (25,0,"6:17:00"), (26,1,NULL), (27,1,NULL), (28,0,"1:29:00"), (29,1,NULL), (30,1,NULL);
true
1939d41a959884b6735ca9a4859760fbc8ccd0a8
SQL
eduardomtz1984/frontendpractica
/firstdb.sql
UTF-8
2,331
3.078125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Jun 13, 2016 at 11:01 PM -- Server version: 10.1.9-MariaDB -- PHP Version: 5.5.30 CREATE DATABASE firstdb; USE firstdb; SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `firstdb` -- -- -------------------------------------------------------- -- -- Table structure for table `books` -- CREATE TABLE `books` ( `id` int(11) NOT NULL, `portada` varchar(125) DEFAULT NULL, `titulo` varchar(125) DEFAULT NULL, `autor` varchar(125) DEFAULT NULL, `isbn` varchar(25) DEFAULT NULL, `reseña` varchar(25) DEFAULT NULL, `cantidad` varchar(25) DEFAULT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `books` -- INSERT INTO `books` (`id`, `portada`, `titulo`, `autor`, `isbn`, `reseña`, `cantidad`) VALUES (1, 'http://200.23.113.50/myproject/book.png', 'titulo 1', 'autor 1', 'isbn1', 'el libro trata ...', '7'), (2, 'http://200.23.113.50/myproject/book.png', 'titulo 2', 'autor 2', 'isbn 2', 'el libro trata ...', '98'), (3, 'http://200.23.113.50/myproject/book.png', 'titulo 3', 'autor 3', 'isbn3', 'el libro trata ...', '1154564'); -- -------------------------------------------------------- -- -- Table structure for table `employee` -- CREATE TABLE `employee` ( `Username` varchar(25) DEFAULT NULL, `Password` varchar(25) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `employee` -- INSERT INTO `employee` (`Username`, `Password`) VALUES ('admin', '123qwe'); -- -- Indexes for dumped tables -- -- -- Indexes for table `books` -- -- ALTER TABLE `books` -- ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `books` -- ALTER TABLE `books` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
5c721c9c7d38a8f9f0f19bac5b1c10dab9862598
SQL
kyriejoshua/learn-sql
/Sample/Ch06/PRACTICE.sql
UTF-8
791
3.765625
4
[]
no_license
-- 第六章练习题 -- 6.1 -- ①得到进货价格不再 500, 2800, 5000 的商品名称和进货价格 -- ②得到和上面一样的数据 ❌ -- ②无法得到任何结果,NOT IN 的陷阱,不可以在其中加入 NULL -- 6.2 -- ❌ SELECT sale_price SUM(CASE WHEN sale_price < 1000 THEN sale_price ELSE 0 END) AS low_price SUM(CASE WHEN sale_price > 1000 AND sale_price < 3000 THEN sale_price ELSE 0 END) AS mid_price SUM(CASE WHEN sale_price > 3000 THEN sale_price ELSE 0 END) AS high_price FROM Product -- 正确的✅ SELECT SUM(CASE WHEN sale_price <= 1000 THEN 1 ELSE 0 END) AS low_price, SUM(CASE WHEN sale_price BETWEEN(1001 AND 3000) THEN 1 ELSE 0 END) AS mid_price, SUM(CASE WHEN sale_price >= 3001 THEN 1 ELSE 0 END) AS high_price, FROM Product
true
bde7915e26514dd8815bd5e71ea16b34337cee88
SQL
jeevi/SocialNetworkingWebsite
/.sql files/preferences.sql
UTF-8
181
2.859375
3
[]
no_license
CREATE TABLE CSETEAM61.PREFERENCES( USERID VARCHAR(20) NOT NULL, USERLIKES VARCHAR(20) NOT NULL, UNIQUE(USERID, USERLIKES), FOREIGN KEY(USERID) REFERENCES CSETEAM61.USERS(USERID) );
true
34cd35deeacb1ce939b94c2066deb83097257ede
SQL
PabloOssola/M4Trader-M4Trader-V0.1
/MonedasDB/orden_owner/Stored Procedures/NOV_ObtenerEstadoNovedad.sql
UTF-8
308
2.578125
3
[]
no_license
CREATE PROCEDURE [orden_owner].[NOV_ObtenerEstadoNovedad] @IdNovedadDeTransferencia int, @IdEstado int output AS BEGIN SET NOCOUNT ON SELECT @IdEstado = IdEstado from orden_owner.NovedadesDeTransferencias where IdNovedadTransferenciaFondo = @IdNovedadDeTransferencia END
true
75dce80e0162f9a92c6092729bcfaae927d5fce5
SQL
brendan-mcgrady/ruby_project
/db/spending_tracker.sql
UTF-8
410
3.234375
3
[]
no_license
DROP TABLE IF EXISTS transactions; DROP TABLE IF EXISTS merchants; DROP TABLE IF EXISTS tags; CREATE TABLE tags( id SERIAL PRIMARY KEY, name VARCHAR ); CREATE TABLE merchants( id SERIAL PRIMARY KEY, name VARCHAR(50) ); CREATE TABLE transactions( id SERIAL PRIMARY KEY, merchant_id INT REFERENCES merchants(id), tag_id INT REFERENCES tags(id), trans_time TIMESTAMP, amount DECIMAL(5, 2) );
true
21330e48d4fcc05f3603d9816aa1963472ef41ac
SQL
LaluAtasaldi/UTS_Semester5
/kurniawan wijaya/kurniawan.sql
UTF-8
7,745
2.953125
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Dec 01, 2018 at 02:14 PM -- Server version: 10.1.19-MariaDB -- PHP Version: 5.5.38 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `kurniawan` -- -- -------------------------------------------------------- -- -- Table structure for table `daftar_jenis` -- CREATE TABLE `daftar_jenis` ( `id_jenis` int(5) NOT NULL, `jenis` varchar(50) NOT NULL, `ket_jenis` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `daftar_jenis` -- INSERT INTO `daftar_jenis` (`id_jenis`, `jenis`, `ket_jenis`) VALUES (1, 'charger', ''), (2, 'handphon', ''), (3, 'komputer', ''), (4, 'kabel', ''), (5, 'matherboot', ''), (7, 'lcd', ''), (8, 'laptop', ''); -- -------------------------------------------------------- -- -- Table structure for table `daftar_kondisi` -- CREATE TABLE `daftar_kondisi` ( `id_kondisi` int(5) NOT NULL, `kondisi` varchar(20) NOT NULL, `ket_kondisi` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `daftar_kondisi` -- INSERT INTO `daftar_kondisi` (`id_kondisi`, `kondisi`, `ket_kondisi`) VALUES (1, 'rusak', ''), (2, 'ringan', ''), (3, 'sakit parah', ''); -- -------------------------------------------------------- -- -- Table structure for table `daftar_pengguna` -- CREATE TABLE `daftar_pengguna` ( `id_pengguna` int(11) NOT NULL, `nama_depan` varchar(50) NOT NULL, `nama_belakang` varchar(50) NOT NULL, `email` varchar(50) NOT NULL, `username` varchar(50) NOT NULL, `password` varchar(50) NOT NULL, `level` varchar(50) NOT NULL, `photo` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `daftar_pengguna` -- INSERT INTO `daftar_pengguna` (`id_pengguna`, `nama_depan`, `nama_belakang`, `email`, `username`, `password`, `level`, `photo`) VALUES (20, 'rama', 'wijaya', 'ramawijaya@gmail.com', 'ramawijaya', '67', 'Admin', 'awan.jpg'), (21, 'hjk', 'jkll', 'kah@gmail.com', 'haskk', '6789', 'User', 'avatar2.png'), (22, 'kaldahlm', 'asdamn m,', 'nalks@yahoo.com', 'amsm', 'adasd', 'User', 'avatar3.png'), (23, 'sahfalkm', 'ahdsj', 'agdah@gmail.com', 'asbd', 'dhuwdhb', 'User', 'ganteng.jpg'), (24, 'asndf', 'basbd', 'AHDAKL@YHAOO.COM', 'ASCNA', 'adcfa', 'User', 'web.jpg'); -- -------------------------------------------------------- -- -- Table structure for table `daftar_ruang` -- CREATE TABLE `daftar_ruang` ( `id_ruang` int(5) NOT NULL, `nama_ruang` varchar(50) NOT NULL, `fungsi_ruang` varchar(50) NOT NULL, `luas` varchar(10) NOT NULL, `gambar_ruang` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `daftar_ruang` -- INSERT INTO `daftar_ruang` (`id_ruang`, `nama_ruang`, `fungsi_ruang`, `luas`, `gambar_ruang`) VALUES (1, 'kamr tdur', 'tempat tidur', '10', '2015720145853.jpg'), (2, 'kamar mandi', 'tempat mandi', '50', 'photo1.png'), (3, 'teras brn', 'tempa bermain', '20', 'mn.jpg'), (4, 'ruang mkn', 'tempat makan', '20', 'sd.jpg'), (6, 'LAB III', 'RUANG PRAKTIK KOMPUTER', '49', 'photo4.jpg'); -- -------------------------------------------------------- -- -- Table structure for table `daftar_satuan` -- CREATE TABLE `daftar_satuan` ( `id_satuan` int(5) NOT NULL, `satuan` varchar(20) NOT NULL, `ket_satuan` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `daftar_satuan` -- INSERT INTO `daftar_satuan` (`id_satuan`, `satuan`, `ket_satuan`) VALUES (1, 'Unit', ''), (2, 'Buah', ''), (3, 'Pasang', ''), (4, 'Lembar', ''), (5, 'satuan', ''); -- -------------------------------------------------------- -- -- Table structure for table `daftar_sumber` -- CREATE TABLE `daftar_sumber` ( `id_sumber` int(5) NOT NULL, `sumber` varchar(20) NOT NULL, `ket_sumber` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `daftar_sumber` -- INSERT INTO `daftar_sumber` (`id_sumber`, `sumber`, `ket_sumber`) VALUES (1, 'anakyatim', ''), (2, 'berkah', ''), (3, 'sodakah', ''); -- -------------------------------------------------------- -- -- Table structure for table `daftar_tahun` -- CREATE TABLE `daftar_tahun` ( `id_tahun` int(5) NOT NULL, `tahun` int(4) NOT NULL, `ket_tahun` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `daftar_tahun` -- INSERT INTO `daftar_tahun` (`id_tahun`, `tahun`, `ket_tahun`) VALUES (1, 2010, ''), (2, 2011, ''), (3, 2012, ''), (4, 2013, ''), (5, 2014, ''), (6, 2015, ''), (7, 2016, ''), (8, 2017, ''), (9, 2018, ''), (10, 2019, ''), (11, 2020, ''); -- -------------------------------------------------------- -- -- Table structure for table `data_iventaris` -- CREATE TABLE `data_iventaris` ( `id_ivn` int(5) NOT NULL, `tanggal` date NOT NULL, `kode_ivn` varchar(15) NOT NULL, `id_ruangan` int(5) NOT NULL, `id_sumber` int(5) NOT NULL, `id_tahun` int(5) NOT NULL, `nama_barang` varchar(50) NOT NULL, `merek` varchar(50) NOT NULL, `seri` varchar(50) NOT NULL, `id_jenis` int(5) NOT NULL, `nilai_wajar` int(10) NOT NULL, `gambar` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Indexes for dumped tables -- -- -- Indexes for table `daftar_jenis` -- ALTER TABLE `daftar_jenis` ADD PRIMARY KEY (`id_jenis`); -- -- Indexes for table `daftar_kondisi` -- ALTER TABLE `daftar_kondisi` ADD PRIMARY KEY (`id_kondisi`); -- -- Indexes for table `daftar_pengguna` -- ALTER TABLE `daftar_pengguna` ADD PRIMARY KEY (`id_pengguna`); -- -- Indexes for table `daftar_ruang` -- ALTER TABLE `daftar_ruang` ADD PRIMARY KEY (`id_ruang`); -- -- Indexes for table `daftar_satuan` -- ALTER TABLE `daftar_satuan` ADD PRIMARY KEY (`id_satuan`); -- -- Indexes for table `daftar_sumber` -- ALTER TABLE `daftar_sumber` ADD PRIMARY KEY (`id_sumber`); -- -- Indexes for table `daftar_tahun` -- ALTER TABLE `daftar_tahun` ADD PRIMARY KEY (`id_tahun`); -- -- Indexes for table `data_iventaris` -- ALTER TABLE `data_iventaris` ADD PRIMARY KEY (`id_ivn`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `daftar_jenis` -- ALTER TABLE `daftar_jenis` MODIFY `id_jenis` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `daftar_kondisi` -- ALTER TABLE `daftar_kondisi` MODIFY `id_kondisi` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `daftar_pengguna` -- ALTER TABLE `daftar_pengguna` MODIFY `id_pengguna` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25; -- -- AUTO_INCREMENT for table `daftar_ruang` -- ALTER TABLE `daftar_ruang` MODIFY `id_ruang` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `daftar_satuan` -- ALTER TABLE `daftar_satuan` MODIFY `id_satuan` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `daftar_sumber` -- ALTER TABLE `daftar_sumber` MODIFY `id_sumber` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `daftar_tahun` -- ALTER TABLE `daftar_tahun` MODIFY `id_tahun` int(5) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; -- -- AUTO_INCREMENT for table `data_iventaris` -- ALTER TABLE `data_iventaris` MODIFY `id_ivn` int(5) NOT NULL AUTO_INCREMENT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
ad5de1ae8685128a12bb7d7562dcea0827023155
SQL
goatking91/ecobay
/ecobay/src/main/webapp/resources/db/ecobay_CREATE TABLE.sql
UTF-8
7,127
3.515625
4
[]
no_license
-- 회원 CREATE TABLE MEMBER ( MEMBER_ID VARCHAR(100) NOT NULL PRIMARY KEY , MEMBER_NAME VARCHAR(100) NOT NULL , PWD VARCHAR(500) NOT NULL , BIRTH VARCHAR(20) NOT NULL , ZIPCODE VARCHAR(10) NOT NULL , ADDR1 VARCHAR(500) NOT NULL , ADDR2 VARCHAR(500) NOT NULL , GENDER VARCHAR(5) NOT NULL default 'M' , PHONE VARCHAR(20) NOT NULL , JOIN_YN BOOLEAN NOT NULL default FALSE , USE_YN BOOLEAN NOT NULL default TRUE , M_TYPE VARCHAR(50) NOT NULL default 'ROLE_USER' , REGDATE DATETIME NOT NULL default now() , MODDATE DATETIME NOT NULL default now() , DELDATE DATETIME NULL ); -- 상품 CREATE TABLE PRODUCT ( PRODUCT_CD VARCHAR(14) NOT NULL PRIMARY KEY , PRODUCT_NM VARCHAR(500) NOT NULL , MEMBER_ID VARCHAR(100) NOT NULL , CLASS_BIG_CD VARCHAR(5) NOT NULL , CLASS_MID_CD VARCHAR(5) NOT NULL , CONTENT TEXT NULL , STATE_CD VARCHAR(5) NOT NULL , STATE_NM VARCHAR(20) NOT NULL , REGDATE DATETIME NOT NULL default now() , MODDATE DATETIME NOT NULL default now() , DELDATE DATETIME NULL , USE_YN BOOLEAN NOT NULL default TRUE , VIEWCNT INT(6) NOT NULL default 0 ); -- 상품이미지 CREATE TABLE PRODUCTIMG ( IMG_CD INT(6) NOT NULL , IMG_IDX INT(6) NOT NULL , PRODUCT_CD VARCHAR(14) NOT NULL , FILENAME VARCHAR(250) NOT NULL , FILENAME_ORG VARCHAR(200) NOT NULL , FILENAME_THUMB VARCHAR(250) NOT NULL , REGDATE DATETIME NOT NULL default now() , PRIMARY KEY(IMG_CD, IMG_IDX) ); ALTER TABLE PRODUCTIMG ADD CONSTRAINT fk_productimg_productcd Foreign KEY ( PRODUCT_CD ) REFERENCES PRODUCT ( PRODUCT_CD ) ON DELETE CASCADE; -- 관심상품 CREATE TABLE PRODUCTWISH ( PRODUCT_CD VARCHAR(14) NOT NULL , MEMBER_ID VARCHAR(100) NOT NULL , REGDATE DATETIME NOT NULL default now() , PRIMARY KEY(PRODUCT_CD, MEMBER_ID) ); ALTER TABLE PRODUCTWISH ADD CONSTRAINT fk_productwish_productcd Foreign KEY ( PRODUCT_CD ) REFERENCES PRODUCT ( PRODUCT_CD ) ON DELETE CASCADE; -- 상품문의 CREATE TABLE PRODUCTQNA ( QNA_IDX INT(6) NOT NULL , PRODUCT_CD VARCHAR(14) NOT NULL , QNA_DIV VARCHAR(5) NOT NULL , MEMBER_ID VARCHAR(100) NOT NULL , TITLE VARCHAR(500) NOT NULL , CONTENT TEXT NULL , REGDATE DATETIME NOT NULL default now() , PRIMARY KEY(QNA_IDX, PRODUCT_CD, QNA_DIV) ); ALTER TABLE PRODUCTQNA ADD CONSTRAINT fk_productqna_productcd Foreign KEY ( PRODUCT_CD ) REFERENCES PRODUCT ( PRODUCT_CD ) ON DELETE CASCADE; -- 경매정보 CREATE TABLE AUCTIONINFO ( PRODUCT_CD VARCHAR(14) NOT NULL PRIMARY KEY , MONEY_FIRST BIGINT NOT NULL , MONEY_LAST BIGINT NULL , MONEY_UNIT BIGINT NOT NULL , AUCTDATE_UNIT INT(6) NOT NULL , ACUTDATE_START DATETIME NULL , ACUTDATE_END DATETIME NULL , BAYNOW_YN BOOLEAN NOT NULL default FALSE , BAYNOW_MONEY BIGINT NULL , REGDATE DATETIME NOT NULL default now() , BAY_MEMBER_ID VARCHAR(100) NULL , PAYMENT_PROC_CD VARCHAR(5) NOT NULL default '0' ); ALTER TABLE AUCTIONINFO ADD CONSTRAINT fk_auctioninfo_productcd Foreign KEY ( PRODUCT_CD ) REFERENCES PRODUCT ( PRODUCT_CD ) ON DELETE CASCADE; -- 입찰내역 CREATE TABLE BIDINFO ( PRODUCT_CD VARCHAR(14) NOT NULL , MEMBER_ID VARCHAR(100) NOT NULL , MONEY_BID BIGINT NOT NULL , REGDATE DATETIME NOT NULL default now() , PRIMARY KEY(PRODUCT_CD, MEMBER_ID, MONEY_BID) ); ALTER TABLE BIDINFO ADD CONSTRAINT fk_bidinfo_productcd Foreign KEY ( PRODUCT_CD ) REFERENCES PRODUCT ( PRODUCT_CD ) ON DELETE CASCADE; -- 배송정보 CREATE TABLE DELIVERYINFO ( PRODUCT_CD VARCHAR(14) NOT NULL PRIMARY KEY , DELI_DIV_CD VARCHAR(5) NOT NULL , DELI_DIV_NM VARCHAR(50) NOT NULL , REGDATE DATETIME NOT NULL default now() ); ALTER TABLE DELIVERYINFO ADD CONSTRAINT fk_deliveryinfo_productcd Foreign KEY ( PRODUCT_CD ) REFERENCES PRODUCT ( PRODUCT_CD ) ON DELETE CASCADE; -- 분류 CREATE TABLE CLASS ( CLASS_BIG_CD VARCHAR(5) NOT NULL , CLASS_MID_CD VARCHAR(5)NOT NULL default 'XX' , CLASS_NM VARCHAR(100) NOT NULL , CLASS_DIV VARCHAR(5) NOT NULL , REGDATE DATETIME NOT NULL default now() , MODDATE DATETIME NOT NULL default now() , DELDATE DATETIME NULL , USE_YN BOOLEAN NOT NULL default TRUE , PRIMARY KEY(CLASS_BIG_CD, CLASS_MID_CD) ); -- 카테고리 CREATE TABLE CATEGORY ( CATEGORY_CD VARCHAR(5) NOT NULL default '' PRIMARY KEY , CATEGORY_NM VARCHAR(100) NOT NULL default '' , REGDATE DATETIME NOT NULL default now() ); -- 상품결제 CREATE TABLE PAYMENT ( PRODUCT_CD VARCHAR(14) NOT NULL PRIMARY KEY , MONEY_PAY BIGINT NOT NULL , REGDATE DATETIME NOT NULL default now() ); ALTER TABLE PAYMENT ADD CONSTRAINT fk_payment_productcd Foreign KEY ( PRODUCT_CD ) REFERENCES PRODUCT ( PRODUCT_CD ) ON DELETE CASCADE; -- 상품배송 CREATE TABLE DELIVERY ( PRODUCT_CD VARCHAR(14) NOT NULL PRIMARY KEY , DELI_NM VARCHAR(100) NOT NULL , DELI_ZIPCODE VARCHAR(10) NOT NULL , DELI_ADDR1 VARCHAR(500) NOT NULL , DELI_ADDR2 VARCHAR(500) NOT NULL , DELI_PHONENUM VARCHAR(20) NOT NULL , REGDATE DATETIME NOT NULL default now() ); ALTER TABLE DELIVERY ADD CONSTRAINT fk_delivery_productcd Foreign KEY ( PRODUCT_CD ) REFERENCES PRODUCT ( PRODUCT_CD ) ON DELETE CASCADE; -- 공지시항 CREATE TABLE NOTICE ( NOTICE_IDX INT(6) NOT NULL AUTO_INCREMENT PRIMARY KEY , TITLE VARCHAR(500) NOT NULL , CONTENT TEXT NULL , REGDATE DATETIME NOT NULL default now() , MODDATE DATETIME NOT NULL default now() , DELDATE DATETIME NULL , VIEWCNT INT(6) NOT NULL default 0 , USE_YN BOOLEAN NOT NULL default TRUE ); -- 공지시항파일 CREATE TABLE NOTICEFILE ( FILE_CD INT(6) NOT NULL , FILE_IDX INT(6) NOT NULL , NOTICE_IDX INT(6) NOT NULL , FILENAME VARCHAR(250) NOT NULL , FILENAME_ORG VARCHAR(200) NOT NULL , FILESIZE BIGINT NOT NULL default 0 , DEL_YN BOOLEAN NOT NULL default FALSE , DELDATE DATETIME NULL , REGDATE DATETIME NOT NULL default now() , PRIMARY KEY(FILE_CD, FILE_IDX, NOTICE_IDX) ); ALTER TABLE NOTICEFILE ADD CONSTRAINT fk_noticefile_notice_idx Foreign KEY ( NOTICE_IDX ) REFERENCES NOTICE ( NOTICE_IDX ) ON DELETE CASCADE; -- FAQ CREATE TABLE FAQ ( FAQ_IDX INT(6) NOT NULL AUTO_INCREMENT PRIMARY KEY , TITLE VARCHAR(500) NOT NULL , CONTENT TEXT NULL , CATEGORY_CD VARCHAR(5) NOT NULL default '' , VIEWCNT INT(6) NOT NULL default 0 , REGDATE DATETIME NOT NULL default now() , MODDATE DATETIME NOT NULL default now() ); -- QNA CREATE TABLE QNA ( QNA_IDX INT(6) NOT NULL AUTO_INCREMENT PRIMARY KEY , MEMBER_ID VARCHAR(100) NOT NULL , TITLE VARCHAR(500) NOT NULL , CONTENT TEXT NULL , REGDATE DATETIME NOT NULL default now() ); -- QNA답변 CREATE TABLE QNAREPLY ( QNARP_IDX INT(6) NOT NULL AUTO_INCREMENT , QNA_IDX INT(6) NOT NULL , CONTENT TEXT NULL , ADMIN_ID VARCHAR(100) NOT NULL , REGDATE DATETIME NOT NULL default now() , PRIMARY KEY(QNARP_IDX, QNA_IDX) ); ALTER TABLE QNAREPLY ADD CONSTRAINT fk_qnareply_qna_idx Foreign KEY ( QNA_IDX ) REFERENCES QNA ( QNA_IDX ) ON DELETE CASCADE; -- 블랙리스트 CREATE TABLE BLACKLIST ( IDX_CD INT(6) NOT NULL AUTO_INCREMENT PRIMARY KEY , MEMBER_ID VARCHAR(100) NOT NULL , REGCONTENT TEXT NULL , CANCONTENT TEXT NULL , BLACK_YN BOOLEAN NOT NULL default TRUE , REGDATE DATETIME NOT NULL default now() , CANDATE DATETIME NULL );
true
e13e2dfe1fe9713fcaa70038b5c2e2c09cecc33f
SQL
radtek/abs3
/sql/mmfo/bars/Table/sv_opruch_rel.sql
WINDOWS-1251
3,564
3.0625
3
[]
no_license
PROMPT ===================================================================================== PROMPT *** Run *** ========== Scripts /Sql/BARS/Table/SV_OPRUCH_REL.sql =========*** Run *** PROMPT ===================================================================================== PROMPT *** ALTER_POLICY_INFO to SV_OPRUCH_REL *** BEGIN execute immediate 'begin bpa.alter_policy_info(''SV_OPRUCH_REL'', ''CENTER'' , null, null, null, null); bpa.alter_policy_info(''SV_OPRUCH_REL'', ''FILIAL'' , null, null, null, null); bpa.alter_policy_info(''SV_OPRUCH_REL'', ''WHOLE'' , null, null, null, null); null; end; '; END; / PROMPT *** Create table SV_OPRUCH_REL *** begin execute immediate ' CREATE TABLE BARS.SV_OPRUCH_REL ( ID NUMBER(10,0), OWNER_ID_TO NUMBER(10,0), OWNER_ID_FROM NUMBER(10,0) ) SEGMENT CREATION DEFERRED PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING TABLESPACE BRSDYND '; exception when others then if sqlcode=-955 then null; else raise; end if; end; / PROMPT *** ALTER_POLICIES to SV_OPRUCH_REL *** exec bpa.alter_policies('SV_OPRUCH_REL'); COMMENT ON TABLE BARS.SV_OPRUCH_REL IS ' . '; COMMENT ON COLUMN BARS.SV_OPRUCH_REL.ID IS '.'; COMMENT ON COLUMN BARS.SV_OPRUCH_REL.OWNER_ID_TO IS ' '; COMMENT ON COLUMN BARS.SV_OPRUCH_REL.OWNER_ID_FROM IS ' '; PROMPT *** Create constraint CC_SVOPRUCHREL_IDFROM_NN *** begin execute immediate ' ALTER TABLE BARS.SV_OPRUCH_REL ADD CONSTRAINT CC_SVOPRUCHREL_IDFROM_NN CHECK (OWNER_ID_FROM IS NOT NULL) ENABLE'; exception when others then if sqlcode=-2260 or sqlcode=-2261 or sqlcode=-2264 or sqlcode=-2275 or sqlcode=-1442 then null; else raise; end if; end; / PROMPT *** Create constraint CC_SVOPRUCHREL_IDTO_NN *** begin execute immediate ' ALTER TABLE BARS.SV_OPRUCH_REL ADD CONSTRAINT CC_SVOPRUCHREL_IDTO_NN CHECK (OWNER_ID_TO IS NOT NULL) ENABLE'; exception when others then if sqlcode=-2260 or sqlcode=-2261 or sqlcode=-2264 or sqlcode=-2275 or sqlcode=-1442 then null; else raise; end if; end; / PROMPT *** Create constraint CC_SVOPRUCHREL_ID_NN *** begin execute immediate ' ALTER TABLE BARS.SV_OPRUCH_REL ADD CONSTRAINT CC_SVOPRUCHREL_ID_NN CHECK (ID IS NOT NULL) ENABLE'; exception when others then if sqlcode=-2260 or sqlcode=-2261 or sqlcode=-2264 or sqlcode=-2275 or sqlcode=-1442 then null; else raise; end if; end; / PROMPT *** Create grants SV_OPRUCH_REL *** grant SELECT on SV_OPRUCH_REL to BARSREADER_ROLE; grant DELETE,INSERT,SELECT,UPDATE on SV_OPRUCH_REL to BARS_ACCESS_DEFROLE; grant DELETE,INSERT,SELECT,UPDATE on SV_OPRUCH_REL to RPBN002; grant SELECT on SV_OPRUCH_REL to UPLD; PROMPT ===================================================================================== PROMPT *** End *** ========== Scripts /Sql/BARS/Table/SV_OPRUCH_REL.sql =========*** End *** PROMPT =====================================================================================
true
f3707461544fc92571477a60dfcffe61dd44b242
SQL
Subham-Yadav/Interview-Preparation
/query.sql
UTF-8
1,658
3.203125
3
[]
no_license
CREATE TABLE HR(id SERIAL, question TEXT); INSERT INTO HR(question) VALUES ('Tell me about yourself.'), ('What motivates you?'), ('How do you evaluate success?'), ('What has been the greatest disappointment in your life?'), ('What do people most often criticize about you?'), ('What is your greatest weakness?'), ('What is your greatest strength?'), ('What type of work environment do you prefer?'), ('Describe a difficult work situation/project and how you overcame it.'), ('What has the most satisfying moment in your life been?'), ('What types of hobbies do you enjoy outside of work?'), ('What is your greatest fear?'); CREATE TABLE casual(id SERIAL, question TEXT); INSERT INTO casual(question) VALUES ('A useless talent that you have?'), ('One food item you can eat everyday?'), ('The last time you said sorry to someone?'), ('Your favourite memory from school till now?'), ('One advice your parents have given you that you always keep in mind?'), ('One thing you wish to do to make the world a better place?'), ('Your best friend forever?'), ('One thing which can easily piss you off?'), ('Your icon?'), ('The person who calls you the most?'), ('A song that you are humming these days?'), ('The last show you binge watched?'), ('The coolest thing you have ever done?'), ('The scariest thing you have ever done?'), ('Your favourite dish?'), ('Your ultimate inspiration?'), ('Your biggest fear?'), ('If you had to make a tatto right now what will it be?'), ('The last time you cried and why?'), ('Where do you see yourself in next 5 years?'), ('One thing which can bring a smile on your face?');
true
939841258afa81704ded8ba967b99af7c51e7b83
SQL
endahlaksmita/tugas-komputasiawan
/web/db/warteg.sql
UTF-8
1,243
2.828125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 3.3.2deb1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Nov 01, 2012 at 03:57 AM -- Server version: 5.1.41 -- PHP Version: 5.3.2-1ubuntu4.18 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `warteg` -- -- -------------------------------------------------------- -- -- Table structure for table `cabang` -- CREATE TABLE IF NOT EXISTS `cabang` ( `id` int(11) NOT NULL AUTO_INCREMENT, `nama_cabang` varchar(150) NOT NULL, `lat` varchar(255) NOT NULL, `long` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ; -- -- Dumping data for table `cabang` -- INSERT INTO `cabang` (`id`, `nama_cabang`, `lat`, `long`) VALUES (1, 'warteg cicendo', '-6.90777656889046', '107.60429383593748'), (2, 'warteg pasirkaliki', '-6.907606153568098', '107.60995866137694'), (3, 'warteg ledeng', '-6.860569182496338', '107.60566712695311'), (4, 'warteg lembang', '-6.822390832237925', '107.63012887316893');
true
07f9f7aa211f857d80b4b646459c5e6cb4e4670a
SQL
gladiopeace/digital-data-syn
/documents/oms/TB_MEDBB.sql
GB18030
2,014
3.25
3
[]
no_license
/* ================================================================================ ṹ:TB_MEDBB ṹ:ý۸ ṹĿ: ================================================================================ */ drop sequence SEQ_TB_MEDBB; drop index AK_TB_MEDBB; drop table TB_MEDBB; create table TB_MEDBB ( MEDBB_ID INTEGER not null, /*ý۸ID */ MEDBB001 INTEGER not null, /*ýID */ MEDBB002 VARCHAR2(8) not null, /*ʼʱ */ MEDBB003 VARCHAR2(8) not null, /*ʱ */ MEDBB004 INTEGER not null, /*λID */ MEDBB005 NUMBER(12,2), /* */ MEDBB006 VARCHAR2(255), /*ע */ CREATE_USER VARCHAR2(12), /*Ա */ USER_GROUP VARCHAR2(12), /*Ա */ CREATE_DATE DATE, /* */ MODIFIER VARCHAR2(12), /*޸Ա */ MODI_DATE DATE, /*޸ */ FLAG NUMBER(1), /*״̬ */ constraint PK_TB_MEDBB primary key (MEDBB_ID) ); create unique index AK_TB_MEDBB on TB_MEDBB (MEDBB001,MEDBB002); create sequence SEQ_TB_MEDBB minvalue 1 maxvalue 9999999999999999999999999999 start with 1 increment by 1 nocache; grant select on TB_MEDBB to public; grant index on TB_MEDBB to public; grant update on TB_MEDBB to public; grant delete on TB_MEDBB to public; grant insert on TB_MEDBB to public; grant select on SEQ_TB_MEDBB to public;
true
e4b3201417ea653645d45ff67355dfd64e7057bf
SQL
anvesh649/mysql
/Mysql_topics/joins.sql
UTF-8
5,740
4.0625
4
[]
no_license
select order_id,o.customer_id from orders o join customers c on o.customer_id=c.customer_id; select * from order_items; select * from products; select order_id,o.product_id,p.name,quantity,o.unit_price from order_items o join products p on o.product_id=p.product_id; select * from order_items oi join sql_inventory.products p on oi.product_id=p.product_id; use sql_hr; select e.employee_id,e.first_name,m.first_name as manager from employees e join employees m on e.reports_to =m.employee_id; select * from employees e join employees m on e.reports_to =m.employee_id; use sql_store; select * from customers; select * from order_statuses; select o.order_id,o.order_date,c.first_name,c.last_name,os.name as status from orders o join order_statuses os on o.status=os.order_status_id join customers c on c.customer_id=o.order_id order by o.order_id; use sql_invoicing; select c.client_id,c.name,c.address,invoice_id,date,amount,pm.name as payment_mode from payments p join payment_methods pm on p.payment_method=pm.payment_method_id join clients c on p.client_id=c.client_id order by c.client_id; use sql_store; select * from order_items oi join order_item_notes oin on oi.order_id=oin.order_id and oi.product_id=oin.product_id; select c.customer_id,c.first_name,o.order_id from customers c left join orders o on c.customer_id=o.customer_id order by c.customer_id; select * from order_items; select * from products; select p.product_id,oi.quantity,name from order_items oi right join products p on oi.product_id=p.product_id order by p.product_id; select * from orders; select * from order_statuses; use sql_invoicing; select * from clients; select * from payments; select date,cl.name as client,p.amount,pm.name from payments p join payment_methods pm on p.payment_method=pm.payment_method_id join clients cl using(client_id) ; use sql_store; select * from payment_methods; select * from customers; Insert into customers(first_name, last_name, birth_date, address, city, state) values('Bohn', 'Smith', '1992-01-01', 'dede', 'city', 'CA'); select * from customers; use sql_invoicing; select count(*) from invoices; select sum(invoice_total) as total_sales from invoices; select sum(invoice_total) from invoices group by client_id; use sql_hr; select salary from employees order by salary desc limit 1; select * from employees limit 1; use sql_invoicing; select * from payments limit 1,1; select date,pm.name,sum(amount) from payments p join payment_methods pm on p.payment_method=pm.payment_method_id group by date,pm.name order by date; use sql_invoicing; select * from invoices; select client_id, invoice_id, sum(invoice_total) as total_sales from invoices group by client_id,invoice_id with rollup; use sql_store; select * from products; select * from products where unit_price>( select unit_price from products where product_id=3 ); use sql_hr; select * from employees; select first_name,salary from employees where salary>( select avg(salary) from employees); select avg(salary) from employees; use sql_store; select name,product_id from products where product_id not in ( select distinct product_id from order_items ); use sql_invoicing; select client_id,name from clients where client_id not in (select distinct client_id from invoices); select * FROM invoices; use sql_store; SELECT * FROM orders; insert into customers values( null,'ewe','ewew','1990-01-23',789388383,'ss','beijing','ss',283628) ; insert into customers (first_name,last_name,address,city,state,points)values( 'Random','Woddty','ss','beijing','df',283628) ; insert into shippers(name) values ('Shipper1'),('Shipper2'),('Shipper3'); select * from product; insert into products (name,quantity_in_stock,unit_price) values ('Rtx 30900',2,2.3), ('lg g305',44,25.3), ('Corsair rx500',35,2.3); insert into orders (customer_id,order_date,status) values (1,'2019-01-02',1); insert into order_items VALUES (last_insert_id(),1,1,2.95), (last_insert_id(),2,1,2.97); select * FROM order_archives; create table order_archives as select * FROM orders; select * FROM order_archives; INSERT INTO order_archives SELECT * FROM orders WHERE order_date<'2019-01-01'; USE sql_invoicing; SELECT * FROM clients; CREATE TABLE payments_don as SELECT i.invoice_id,number,i.payment_date,name AS client_name FROM invoices i JOIN clients c ON i.client_id = c.client_id WHERE i.payment_date IS NOT NULL; SELECT * FROM payments_done pd; SELECT * FROM invoices i; UPDATE invoices i set i.payment_total=i.invoice_total*0.5,i.payment_date=i.due_date where i.invoice_id IN(17,18); USE sql_store; SELECT * FROM customers c; UPDATE customers set points=points+500 WHERE birth_date<'1993-07-17'; USE sql_invoicing; UPDATE invoices set payment_total=invoice_total*0.5, payment_date=due_date WHERE client_id in (select client_id FROM clients WHERE name='Myworks' OR name='vinte'); USE sql_store; select * FROM customers; -- UPDATE customers set SELECT * FROM orders; SELECT * from customers c; UPDATE orders set comments='Gold Customer' WHERE customer_id IN (SELECT customer_id FROM customers WHERE points>3000); (SELECT customer_id FROM customers WHERE points>3000); DELETE FROM orders WHERE order_id=2; SELECT * FROM orders WHERE order_id=2; USE sql_invoicing; DELETE FROM invoices WHERE client_id=2; SELECT * FROM invoices;
true
ae949c75260c0d4aa64a414704c69c1cf9b13d17
SQL
sbj1234567892010/MiniSQL
/data.sql
UTF-8
1,258
3.5625
4
[]
no_license
create table student ( sno char(8), sname char(16) unique, sage int, sgender char (1), primary key ( sage ) ); create index index1 on student (sno); create index index1 on student (sname); create index index2 on student (sname); drop index index2 on student; insert into student values ('123456','a',27,'F'); insert into student values ('12345','b',28,'M'); insert into student values ('12345678','c',29,'M'); insert into student values ('1234567','d',30,'M'); insert into student values ('123456','e',31,'F'); insert into student values ('12345','f',32,'M'); insert into student values ('12345678','g',21,'M'); insert into student values ('1234567','h',22,'M'); insert into student values ('123456','i',23,'F'); insert into student values ('12345','j',24,'M'); insert into student values ('12345678','k',25,'M'); insert into student values ('1234567','l',26,'M'); select * from student; select * from student where sname > 'c' and sage < 25; select * from student where sage < 24 ; select * from student where sage < 24 and sgender <> 'F'; delete from student where sage < 24 and sgender <> 'F'; select * from student where sage < 24 ; select sno from student; select sno,sname from student where sname > 'c' and sage < 25; drop table student; quit;
true
1f9ab7091cae5d5029c8284000763ecc0edcfbaa
SQL
rubensantibanezacosta/Common_ionic_Project
/backend/import.sql
UTF-8
6,167
3.21875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.9.5deb2 -- https://www.phpmyadmin.net/ -- -- Servidor: localhost:3306 -- Tiempo de generación: 13-10-2021 a las 11:24:30 -- Versión del servidor: 8.0.26-0ubuntu0.20.04.3 -- Versión de PHP: 7.4.3 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Base de datos: `Common` -- CREATE DATABASE Common; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `employees` -- CREATE TABLE `employees` ( `employee_id` int NOT NULL, `imageurl` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, `name` varchar(50) NOT NULL, `job` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Volcado de datos para la tabla `employees` -- INSERT INTO `employees` (`employee_id`, `imageurl`, `name`, `job`) VALUES (4, 'https://images.pexels.com/photos/2726111/pexels-photo-2726111.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500', 'Andrea Martínez', 'Directora de Proyectos'), (5, 'https://images.pexels.com/photos/697509/pexels-photo-697509.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940', 'Alberto Gómez', 'Director comercial'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `products` -- CREATE TABLE `products` ( `product_id` int NOT NULL, `name` varchar(200) NOT NULL, `imageurl` varchar(2000) NOT NULL, `description` varchar(2000) NOT NULL, `price` float NOT NULL, `categoria` varchar(500) NOT NULL, `subcategoria` varchar(500) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Volcado de datos para la tabla `products` -- INSERT INTO `products` (`product_id`, `name`, `imageurl`, `description`, `price`, `categoria`, `subcategoria`) VALUES (1, 'Cámara Kodak', 'https://images.pexels.com/photos/90946/pexels-photo-90946.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940', 'Camara de uso profesional', 625, 'Electrónica', 'Cámaras'), (3, 'Leche Natural', 'https://images.pexels.com/photos/248412/pexels-photo-248412.jpeg?cs=srgb&dl=pexels-pixabay-248412.jpg&fm=jpg', 'Leche natural directa de la vaca', 3.5, 'Alimentación', 'Lácteos'), (4, 'Reloj despertador', 'https://images.pexels.com/photos/36351/the-eleventh-hour-disaster-alarm-clock-clock.jpg?auto=compress&cs=tinysrgb&dpr=1&w=500', 'Reloj despertador con diferentes sonidos', 15, 'Electrónica', 'Relojes'), (5, 'Portátil gaming MSI Intel i9', 'https://assets.mmsrg.com/isr/166325/c1/-/pixelboxx-mss-81304396/fee_786_587_png', 'Laptop gaming MSI de alto rendimiento. Procesador i9, Nvidia gtx 3010Ti ', 1699.9, 'Electrónica', 'Portátiles'), (6, 'HUAWEI Watch GT2', 'https://img01.huaweifile.com/eu/es/huawei/pms/product/6901443320080/800_800_542DBFA46777EB3A9DF03BBCCAA3C81375B32AC530BECBE8mp.png', 'HUAWEI Watch GT2 Marrón 46mm', 139, 'Electrónica', 'Relojes'), (7, 'Optimum Nutrition Proteína', 'https://cdn3.bulevip.com/1177873/optimum-nutrition-100-whey-gold-standard-5-lbs-227-kg.jpg', 'Optimum Nutrition Proteína On 100% Whey Gold Standard 5 Lbs (2,27 Kg)', 59.99, 'Alimentación', 'Suplementos'), (8, 'Mars Mesa Gaming', 'https://thumb.pccomponentes.com/w-530-530/articles/33/335300/1307-mars-gaming-mgd-rgb-mesa-gaming.jpg', 'Mars Gaming MGD RGB Mesa Gaming', 165.9, 'Hogar', 'Periféricos'), (9, 'APPLE Watch 7', 'https://store.storeimages.cdn-apple.com/4668/as-images.apple.com/is/MKU83_VW_34FR+watch-41-alum-midnight-nc-7s_VW_34FR_WF_CO?wid=1400&hei=1400&trim=1,0&fmt=p-jpg&qlt=95&.v=1632171038000,1631661171000', 'Apple Watch\r\nCaja de aluminio en color medianoche - Correa deportiva', 429.9, 'Electrónica', 'Relojes'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `product_tags` -- CREATE TABLE `product_tags` ( `product_id` int NOT NULL, `tag` varchar(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `Users` -- CREATE TABLE `Users` ( `email` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, `name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, `password` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, `access` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- -- Volcado de datos para la tabla `Users` -- INSERT INTO `Users` (`email`, `name`, `password`, `access`) VALUES ('ruben@ruben.com', 'Ruben', '1234', 'admin'), ('test2@test.com', 'test2', '1234', 'user'); -- -- Índices para tablas volcadas -- -- -- Indices de la tabla `employees` -- ALTER TABLE `employees` ADD PRIMARY KEY (`employee_id`); -- -- Indices de la tabla `products` -- ALTER TABLE `products` ADD PRIMARY KEY (`product_id`); -- -- Indices de la tabla `product_tags` -- ALTER TABLE `product_tags` ADD PRIMARY KEY (`product_id`,`tag`); -- -- Indices de la tabla `Users` -- ALTER TABLE `Users` ADD PRIMARY KEY (`email`); -- -- AUTO_INCREMENT de las tablas volcadas -- -- -- AUTO_INCREMENT de la tabla `employees` -- ALTER TABLE `employees` MODIFY `employee_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT de la tabla `products` -- ALTER TABLE `products` MODIFY `product_id` int NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- Restricciones para tablas volcadas -- -- -- Filtros para la tabla `product_tags` -- ALTER TABLE `product_tags` ADD CONSTRAINT `product_tags_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `products` (`product_id`) ON DELETE CASCADE ON UPDATE CASCADE; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
b42cc4501e6f1cc3e44a2b49acecb33928c599dc
SQL
lbz320/Stanford-DB-Class-Exercises-and-Notes
/DB11_Constraints_and_Triggers/Q6.sql
UTF-8
547
3.8125
4
[]
no_license
--Q6 --Write a trigger to enforce the following behavior: If A liked B but is updated to A liking C instead, and B and C were friends, make B and C no longer friends. Don't forget to delete the friendship in both directions, and make sure the trigger only runs when the "liked" (ID2) person is changed but the "liking" (ID1) person is not changed. CREATE TRIGGER t8 AFTER UPDATE ON Likes FOR EACH ROW WHEN (New.ID2!=Old.ID2 AND New.ID1=Old.ID1) BEGIN DELETE FROM Friend WHERE (ID1=New.ID2 AND ID2=Old.ID2) OR (ID1=OLD.ID2 AND ID2=New.ID2); END
true
c230c1204b17e77104f51b4b8a1efcbb525cd983
SQL
VineetkumarPatil/docker_examples
/PostgreSQL/scripts/postgis_tables.sql
UTF-8
1,231
3.140625
3
[]
no_license
SET temp_file_limit = 37050832 ; CREATE USER test; CREATE DATABASE postgres WITH OWNER postgres; GRANT ALL PRIVILEGES ON DATABASE postgres TO postgres,test,docker; \connect postgres; SET temp_file_limit = 37050832 ; CREATE EXTENSION postgis VERSION "2.3.3"; -- CREATE EXTENSION postgis_raster VERSION "2.3.3"; -- CREATE EXTENSION postgis_sfcgal; -- CREATE EXTENSION address_standardizer; -- CREATE EXTENSION fuzzystrmatch; -- CREATE EXTENSION postgis_topology; -- CREATE EXTENSION postgis_tiger_geocoder; CREATE TABLE IF NOT EXISTS products ( product_no integer, name varchar(10), price numeric ); INSERT INTO products (product_no, name, price) VALUES (1, 'Cheese', 9.99); INSERT INTO products (name, price, product_no) VALUES ('Butter', 10.08, 2); INSERT INTO products (product_no, name, price) VALUES (3, 'Jam', 19.99); INSERT INTO products (product_no, name, price) VALUES (4, 'Bread', 9.88); INSERT INTO products (product_no, name, price) VALUES (5, 'Toast', 3.99); INSERT INTO products (product_no, name, price) VALUES (6, 'Sandwitch', 8.5); INSERT INTO products (product_no, name, price) VALUES (7, 'Dosa', 30.4); INSERT INTO products (product_no, name, price) VALUES (8, 'Idli', 9.43); COMMIT;
true
a9d8668ecbb6ccefa0a4a3a526c81af93ff80a50
SQL
ddboline/garmin_rust
/migrations/V15__ids_integer_to_uuid.sql
UTF-8
5,100
3.421875
3
[ "MIT" ]
permissive
CREATE EXTENSION IF NOT EXISTS pgcrypto; ALTER TABLE garmin_corrections_laps DROP COLUMN id; ALTER TABLE garmin_corrections_laps ADD COLUMN id UUID PRIMARY KEY NOT NULL DEFAULT gen_random_uuid(); ALTER TABLE scale_measurements DROP COLUMN id; ALTER TABLE scale_measurements ADD COLUMN id UUID PRIMARY KEY NOT NULL DEFAULT gen_random_uuid(); ALTER TABLE race_results_garmin_summary DROP COLUMN id; ALTER TABLE race_results_garmin_summary ADD COLUMN id UUID PRIMARY KEY NOT NULL DEFAULT gen_random_uuid(); ALTER TABLE race_results ADD COLUMN id_temp UUID NOT NULL DEFAULT gen_random_uuid(); ALTER TABLE race_results_garmin_summary ADD COLUMN race_id_temp UUID; UPDATE race_results_garmin_summary SET race_id_temp = ( SELECT distinct id_temp FROM race_results WHERE id = race_results_garmin_summary.race_id ) WHERE race_id IS NOT NULL; ALTER TABLE race_results_garmin_summary DROP CONSTRAINT race_results_garmin_summary_race_id_fkey; ALTER TABLE race_results DROP COLUMN id; ALTER TABLE race_results ADD COLUMN id UUID; UPDATE race_results SET id=id_temp; ALTER TABLE race_results DROP COLUMN id_temp; ALTER TABLE race_results ALTER COLUMN id SET NOT NULL; ALTER TABLE race_results ALTER COLUMN id SET DEFAULT gen_random_uuid(); ALTER TABLE race_results ADD PRIMARY KEY (id); ALTER TABLE race_results_garmin_summary DROP COLUMN race_id; ALTER TABLE race_results_garmin_summary ADD COLUMN race_id UUID REFERENCES race_results (id); UPDATE race_results_garmin_summary SET race_id=race_id_temp; ALTER TABLE race_results_garmin_summary DROP COLUMN race_id_temp; ALTER TABLE garmin_summary ADD COLUMN id_temp UUID NOT NULL DEFAULT gen_random_uuid(); ALTER TABLE fitbit_activities ADD COLUMN summary_id_temp UUID; UPDATE fitbit_activities SET summary_id_temp = ( SELECT id_temp FROM garmin_summary WHERE id = fitbit_activities.summary_id ) WHERE summary_id IS NOT NULL; ALTER TABLE fitbit_activities DROP CONSTRAINT fitbit_activities_summary_id_fkey; ALTER TABLE garmin_connect_activities ADD COLUMN summary_id_temp UUID; UPDATE garmin_connect_activities SET summary_id_temp = ( SELECT id_temp FROM garmin_summary WHERE id = garmin_connect_activities.summary_id ) WHERE summary_id IS NOT NULL; ALTER TABLE garmin_connect_activities DROP CONSTRAINT garmin_connect_activities_summary_id_fkey; ALTER TABLE garmin_corrections_laps ADD COLUMN summary_id_temp UUID; UPDATE garmin_corrections_laps SET summary_id_temp = ( SELECT id_temp FROM garmin_summary WHERE id = garmin_corrections_laps.summary_id ) WHERE summary_id IS NOT NULL; ALTER TABLE garmin_corrections_laps DROP CONSTRAINT garmin_corrections_laps_summary_id_fkey; ALTER TABLE race_results_garmin_summary ADD COLUMN summary_id_temp UUID; UPDATE race_results_garmin_summary SET summary_id_temp = ( SELECT id_temp FROM garmin_summary WHERE id = race_results_garmin_summary.summary_id ) WHERE summary_id IS NOT NULL; ALTER TABLE race_results_garmin_summary DROP CONSTRAINT race_results_garmin_summary_summary_id_fkey; ALTER TABLE strava_activities ADD COLUMN summary_id_temp UUID; UPDATE strava_activities SET summary_id_temp = ( SELECT id_temp FROM garmin_summary WHERE id = strava_activities.summary_id ) WHERE summary_id IS NOT NULL; ALTER TABLE strava_activities DROP CONSTRAINT strava_activities_summary_id_fkey; ALTER TABLE garmin_summary DROP COLUMN id; ALTER TABLE garmin_summary ADD COLUMN id UUID; UPDATE garmin_summary SET id=id_temp; ALTER TABLE garmin_summary DROP COLUMN id_temp; ALTER TABLE garmin_summary ALTER COLUMN id SET NOT NULL; ALTER TABLE garmin_summary ALTER COLUMN id SET DEFAULT gen_random_uuid(); ALTER TABLE garmin_summary ADD PRIMARY KEY (id); ALTER TABLE fitbit_activities DROP COLUMN summary_id; ALTER TABLE fitbit_activities ADD COLUMN summary_id UUID REFERENCES garmin_summary (id); UPDATE fitbit_activities SET summary_id=summary_id_temp; ALTER TABLE fitbit_activities DROP COLUMN summary_id_temp; ALTER TABLE garmin_connect_activities DROP COLUMN summary_id; ALTER TABLE garmin_connect_activities ADD COLUMN summary_id UUID REFERENCES garmin_summary (id); UPDATE garmin_connect_activities SET summary_id=summary_id_temp; ALTER TABLE garmin_connect_activities DROP COLUMN summary_id_temp; ALTER TABLE garmin_corrections_laps DROP COLUMN summary_id; ALTER TABLE garmin_corrections_laps ADD COLUMN summary_id UUID REFERENCES garmin_summary (id); UPDATE garmin_corrections_laps SET summary_id=summary_id_temp; ALTER TABLE garmin_corrections_laps DROP COLUMN summary_id_temp; ALTER TABLE race_results_garmin_summary DROP COLUMN summary_id; ALTER TABLE race_results_garmin_summary ADD COLUMN summary_id UUID REFERENCES garmin_summary (id); UPDATE race_results_garmin_summary SET summary_id=summary_id_temp; ALTER TABLE race_results_garmin_summary DROP COLUMN summary_id_temp; ALTER TABLE strava_activities DROP COLUMN summary_id; ALTER TABLE strava_activities ADD COLUMN summary_id UUID REFERENCES garmin_summary (id); UPDATE strava_activities SET summary_id=summary_id_temp; ALTER TABLE strava_activities DROP COLUMN summary_id_temp;
true
3e8db767f88e5a35bc7451a6605eff518a7f4a02
SQL
e2simplon/immobourse
/immobourse.sql
UTF-8
12,140
3.078125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.5.4.1deb2ubuntu2 -- http://www.phpmyadmin.net -- -- Client : localhost -- Généré le : Lun 18 Décembre 2017 à 16:24 -- Version du serveur : 5.7.20-0ubuntu0.16.04.1 -- Version de PHP : 7.0.22-0ubuntu0.16.04.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Base de données : `immobourse` -- -- -------------------------------------------------------- -- -- Structure de la table `affilates` -- CREATE TABLE `affilates` ( `id` int(11) UNSIGNED NOT NULL, `nom` varchar(80) DEFAULT NULL, `type` varchar(80) DEFAULT NULL, `address` varchar(100) DEFAULT NULL, `phone` int(10) UNSIGNED ZEROFILL DEFAULT NULL, `contact_name` varchar(80) DEFAULT NULL, `email` varchar(255) DEFAULT NULL, `site` varchar(150) DEFAULT NULL, `societe` varchar(100) DEFAULT NULL, `prenom` varchar(30) DEFAULT NULL, `id_ville` int(11) UNSIGNED NOT NULL, `couleur` varchar(7) DEFAULT '#FFFFFF', `logo` varchar(255) NOT NULL DEFAULT 'default.png' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Contenu de la table `affilates` -- INSERT INTO `affilates` (`id`, `nom`, `type`, `address`, `phone`, `contact_name`, `email`, `site`, `societe`, `prenom`, `id_ville`, `couleur`, `logo`) VALUES (1, 'imaj immo', 'agence immobilière', 'centre ville, epinal', 0309090909, 'madame', 'imajimmo@hotmail.fr', '', NULL, NULL, 0, '#999966', 'logo-1.png'), (2, '', 'professionnel', '6 Rue d Epinal - ', 0637881940, NULL, 'julien.b@gdim.fr', 'https://www.agdim.fr/', 'AGDIM ', NULL, 16, '#ff6699', 'default.png'), (3, NULL, 'professionnel', '9 Quai Contades -', 0329822626, NULL, 'contact@delbet.fr', 'http://www.delbet.fr/', 'Agence DELBET', NULL, 5, '#ffcc00', 'default.png'), (4, NULL, 'professionel', '108 rue d Alsace', 0673481889, NULL, 'johann.grandgirard@orange.fr', 'http://www.immod.fr/', 'Agence ImmoD.fr', NULL, 17, '#660066', 'default.png'), (5, NULL, 'professionnel', '1 Place Emile Stein', 0684364610, NULL, 'gdevesinne@gmail.com', 'http://www.apostrophes.fr/', 'APOSTROPHES', NULL, 5, '#cc33ff', 'default.png'), (6, NULL, 'professionnel', '22 PLace des Vosges', 0329333000, NULL, 'philipe.bigaut@fonciafrance.fr', 'http://agence.foncia.com/epinal-88000/agence-immobiliere/foncia-aubert-1871', 'FONCIA Aubert', NULL, 5, '#0066cc', 'default.png'), (7, NULL, 'professionnel', '8 rue Dauphine', 0608729020, NULL, 'philipe.bigaut@fonciafrance.fr', 'http://agence.foncia.com/saint-die-des-vosges-88100/agence-immobiliere/foncia-dauphine-1686', 'FONCIA Dauphine', NULL, 12, '#00ff00', 'default.png'), (8, NULL, 'professionnel', ' 50 Rue Charles de Gaulle ', 0329636030, NULL, 'marie.vaxelaire@fonciafrance.fr', 'http://agence.foncia.com/gerardmer-88400/agence-immobiliere/foncia-pont-du-lac-1687', 'FONCIA Pont du Lac', NULL, 6, '#ff0000', 'default.png'); -- -------------------------------------------------------- -- -- Structure de la table `connection` -- CREATE TABLE `connection` ( `mail` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `statut` tinyint(1) NOT NULL DEFAULT '0', `id_affilates` int(11) UNSIGNED ZEROFILL NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Structure de la table `offers` -- CREATE TABLE `offers` ( `id` int(11) NOT NULL, `description` text, `bridge_height` int(11) DEFAULT NULL, `picture_url` varchar(255) DEFAULT NULL, `address` varchar(100) DEFAULT NULL, `subdividable` tinyint(1) DEFAULT '0', `surface` int(11) DEFAULT NULL, `price` int(11) DEFAULT NULL, `suiviName` varchar(80) DEFAULT NULL, `suiviTel` varchar(10) DEFAULT NULL, `pdf_url` varchar(255) DEFAULT NULL, `latitude` float DEFAULT NULL, `longitude` float DEFAULT NULL, `commission_included` tinyint(1) NOT NULL DEFAULT '0', `transaction_types_ids` varchar(255) NOT NULL, `offer_types_ids` varchar(255) NOT NULL, `affilate_id` int(11) NOT NULL, `id_zoneActivite` tinyint(2) UNSIGNED DEFAULT NULL, `priceTaxe` tinyint(1) NOT NULL DEFAULT '0', `priceM2` smallint(5) UNSIGNED DEFAULT NULL, `priceM2Taxe` tinyint(1) NOT NULL DEFAULT '0', `dateDispo` date DEFAULT NULL, `id_ville` int(10) UNSIGNED NOT NULL, `suiviMail` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Contenu de la table `offers` -- INSERT INTO `offers` (`id`, `description`, `bridge_height`, `picture_url`, `address`, `subdividable`, `surface`, `price`, `suiviName`, `suiviTel`, `pdf_url`, `latitude`, `longitude`, `commission_included`, `transaction_types_ids`, `offer_types_ids`, `affilate_id`, `id_zoneActivite`, `priceTaxe`, `priceM2`, `priceM2Taxe`, `dateDispo`, `id_ville`, `suiviMail`) VALUES (2, '800m² de plein pied\r\ntransformation possible à la demande pour bureau\r\ngrand paking\r\nprix indiqué pour commerce, à étudier pour transformation en bureau\r\nSurface (en m²) : 800 (Surface divisible)\r\nPrix : 50 €/m²\r\nLocalisation (canton par défaut) : EPINAL ZA : Zone de la Voivre\r\nHauteur sous faîtage :\r\nCommission incluse : Non précisé\r\nRéférence offre commercialisateur : ', NULL, '6_1.jpg', 'Zone de la Voivre', 1, 800, 40000, 'MARX Catherine', '0675660784', 'ficheoffre_pdf.php?id=35', 40.7344, -73.8671, 0, '1', '1,2', 9, NULL, 0, 50, 0, NULL, 5, NULL), (3, 'blfgsf ii g dghi d dhihnvlkdfn fv fh ihoi v xkvbfx fvj nf cjk bkbjfvbjfdv\r\n ufhv fv flxbnl kn vmk\r\n uxv lknv f hbbn,bv fgbn gfd h hgf gh hgf fgh f cdx dfg hg vfc dfgh..\r\n\r\n\r\nkjhgfd fj hgf d fgh jhgfds dfgh jh gvfcdx xsdfgh gf cdxdfghj hgfd fghjko poi uyt rez ertyuj nbvgfr tyu ijh gftyuk,jn\r\ngh jkljhgfgh jhgf df ghjjnd\r\nhj gfdfgh hgf ghjhg.', 5, '2_1.jpg', 'zone de l\'imaginaire', NULL, 400, 20000, NULL, NULL, 'ficheoffre_pdf.php?id=35', 40.7344, -73.8671, 1, '2', '3', 5, 2, 1, NULL, 0, '2018-01-01', 5, NULL), (4, ' a a a a aaaaaaaaaaa dhihnvlkdfn fv fh ihoi v xkvbfx fvj nf cjk bkbjfvbjfdv\r\n ufhv fv flxbnl kn vmk\r\n uxv lknvaaa aaaaf hbbn,bv fgbn gfd h hgf gh hgf fgh f cdx dfg hg vfc dfgh\r\nkjhgfd fj hgf d fgh jhgfds dfgh jh gvfcdx xsdfgh gf cdxdfgh aaaaaaaaaaa a a aj hgfd fghjko poi uyt rez ertyuj nbvgfr tyu ijh gftyuk,jn\r\ngh jkljhgfgh jhgf df ghjjnd\r\nhj gfdfgh hgf ghjhg.', NULL, '3_1.jpg', '7 rue du centre ville', 1, 100, 10000, 'MONSIEUR monsieur', '0675660784', 'ficheoffre_pdf.php?id=34', 40.7344, -73.8671, 0, '2,3', '5', 3, 1, 1, NULL, 0, '2018-01-02', 5, NULL), (5, ' bbbbbb b b b b b b b b bbbbbb dhihnvlkdfn fv fh ihoi v xkvbfx fvj nf cjk bgf d fgh jhgfds dfgh jh gvfcdx xsdfgh gf cdxdfgh bbbbbbbb a a aj hgfd fghjko poi uyt rez ertyuj nbvgfr tyu ijh gftyuk,jn\r\ngh jkljhgfgh jhgf df ghjjnd\r\nhj gfdfgh hgf ghjhg.', NULL, '4_1.jpg', '7 rue du centre ville', 0, 500, 15000, 'MADAME monsieur', '0675660784', 'ficheoffre_pdf.php?id=4', 40.7344, -73.8671, 1, '3', '8', 3, NULL, 0, 60, 1, '2017-12-01', 1, NULL), (6, 'cccc c c c c ccccccc ccccccccccc cc dhihnvlkdfn fv fh ihoi v xkvbfx fvj nf cjk bgf d fgh jhgfds dfgh jh gvfcdx xsdfgh gf cdxdfgh bbbbbbbb a a aj hgfd fghjkccccc ertyuj nbvgfr tyu ijh gftyuk,jn\r\ngh jkljhgfgh jhgf df ghjjnd\r\nhj gfdfgh hgf ghjhg.cccc c c c c cccccc', 12, '5_1.jpg', '12 rue de la mairie', 1, 500, NULL, 'MONSIEUR madame', '0675660784', 'ficheoffre_pdf.php?id=5', 40.7344, -73.8671, 0, '3,2', '6', 2, 3, 0, 30, 1, '2018-01-11', 2, NULL); -- -------------------------------------------------------- -- -- Structure de la table `offers_types` -- CREATE TABLE `offers_types` ( `id` int(11) NOT NULL, `nameType` varchar(30) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Contenu de la table `offers_types` -- INSERT INTO `offers_types` (`id`, `nameType`) VALUES (1, 'Bureau'), (2, 'Commerce'), (3, 'Entrepôt'), (4, 'Industrie'), (5, 'Terrain'), (6, 'Laboratoire'), (7, 'Salle de séminaire'), (8, 'Espace congrès'), (9, 'Coworking'); -- -------------------------------------------------------- -- -- Structure de la table `pictures` -- CREATE TABLE `pictures` ( `id` int(11) NOT NULL, `url` varchar(255) NOT NULL, `offers_id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Contenu de la table `pictures` -- INSERT INTO `pictures` (`id`, `url`, `offers_id`) VALUES (2, '2_1.jpg', 2), (3, '2_2.jpg', 2), (4, '3_1.jpg', 3), (5, '3_2.jpg', 3), (6, '3_3.jpg', 3), (7, '4_1.jpg', 4), (8, '5_1.jpg', 5), (9, '5_2.jpg', 5), (10, '5_3.jpg', 5), (11, '5_6.jpg', 5), (12, '6_1.jpg', 6), (13, '6_2.jpg', 6); -- -------------------------------------------------------- -- -- Structure de la table `transactions_types` -- CREATE TABLE `transactions_types` ( `id` int(11) NOT NULL, `nameTransac` varchar(30) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Contenu de la table `transactions_types` -- INSERT INTO `transactions_types` (`id`, `nameTransac`) VALUES (1, 'Location'), (2, 'Location / Vente'), (3, 'Vente'); -- -------------------------------------------------------- -- -- Structure de la table `villes` -- CREATE TABLE `villes` ( `id` int(10) UNSIGNED NOT NULL, `codePostal` int(5) UNSIGNED NOT NULL, `nameVille` varchar(100) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Contenu de la table `villes` -- INSERT INTO `villes` (`id`, `codePostal`, `nameVille`) VALUES (1, 88250, 'La Bresse'), (2, 88600, 'Bruyères'), (3, 88130, 'Charmes'), (4, 88260, 'Darney'), (5, 88000, 'Épinal'), (6, 88400, 'Gérardmer'), (7, 88190, 'Golbey'), (8, 88500, 'Mirecourt'), (9, 88300, 'Neufchâteau'), (10, 88110, 'Raon-l\'Etape'), (11, 88200, 'Remiremont'), (12, 88100, 'Saint-Dié-des-Vosges'), (13, 88160, 'Le Thillot'), (14, 88340, 'Le Val-d\'Ajol'), (15, 88800, 'Vittel'), (16, 88150, 'Chavelot'), (17, 88150, 'Thaon vosges'); -- -------------------------------------------------------- -- -- Structure de la table `zones_activites` -- CREATE TABLE `zones_activites` ( `id` tinyint(2) UNSIGNED NOT NULL, `nameZone` varchar(30) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Contenu de la table `zones_activites` -- INSERT INTO `zones_activites` (`id`, `nameZone`) VALUES (1, 'Centre ville'), (2, ' Zone d\'activité'), (3, 'Périphérie'); -- -- Index pour les tables exportées -- -- -- Index pour la table `affilates` -- ALTER TABLE `affilates` ADD PRIMARY KEY (`id`); -- -- Index pour la table `offers` -- ALTER TABLE `offers` ADD PRIMARY KEY (`id`), ADD KEY `offers_fk1a` (`transaction_types_ids`), ADD KEY `offers_fk2a` (`offer_types_ids`), ADD KEY `offers_fk3a` (`affilate_id`); -- -- Index pour la table `offers_types` -- ALTER TABLE `offers_types` ADD PRIMARY KEY (`id`); -- -- Index pour la table `pictures` -- ALTER TABLE `pictures` ADD PRIMARY KEY (`id`), ADD KEY `pictures_fk0` (`offers_id`); -- -- Index pour la table `transactions_types` -- ALTER TABLE `transactions_types` ADD PRIMARY KEY (`id`); -- -- Index pour la table `villes` -- ALTER TABLE `villes` ADD PRIMARY KEY (`id`); -- -- Index pour la table `zones_activites` -- ALTER TABLE `zones_activites` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT pour les tables exportées -- -- -- AUTO_INCREMENT pour la table `affilates` -- ALTER TABLE `affilates` MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT pour la table `offers` -- ALTER TABLE `offers` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT pour la table `offers_types` -- ALTER TABLE `offers_types` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT pour la table `pictures` -- ALTER TABLE `pictures` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; -- -- AUTO_INCREMENT pour la table `transactions_types` -- ALTER TABLE `transactions_types` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT pour la table `villes` -- ALTER TABLE `villes` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
710cf976ee948faad652174e5d2cdece4af04ac6
SQL
NebelGG/-coursework_mysql
/socialview.sql
UTF-8
31,862
4.15625
4
[]
no_license
DROP DATABASE IF EXISTS socialview; CREATE DATABASE socialview; USE socialview; -- ----------------------------------- GENERAL INFO DROP TABLE IF EXISTS companies; CREATE TABLE companies ( id SERIAL PRIMARY KEY, company VARCHAR(200) UNIQUE NOT NULL ); DROP TABLE IF EXISTS countries; CREATE TABLE countries ( id SERIAL PRIMARY KEY, country VARCHAR(200) UNIQUE NOT NULL ); DROP TABLE IF EXISTS genres; CREATE TABLE genres ( id SERIAL PRIMARY KEY, genre VARCHAR(200) UNIQUE NOT NULL ); DROP TABLE IF EXISTS images; CREATE TABLE images ( id SERIAL PRIMARY KEY, filename VARCHAR(200) NOT NULL, path VARCHAR(200) NOT NULL ); DROP TABLE IF EXISTS roles; CREATE TABLE roles ( id SERIAL PRIMARY KEY, role VARCHAR(200) UNIQUE NOT NULL ); DROP TABLE IF EXISTS title_types; CREATE TABLE title_types ( id SERIAL PRIMARY KEY, title_type VARCHAR(200) UNIQUE NOT NULL ); -- ----------------------------------- USERS DROP TABLE IF EXISTS users; CREATE TABLE users ( id SERIAL PRIMARY KEY, signed_up_at TIMESTAMP DEFAULT now(), username VARCHAR(50) UNIQUE, email VARCHAR(100) UNIQUE, phone_number BIGINT UNSIGNED UNIQUE, password_hash VARCHAR(100) ); DROP TABLE IF EXISTS user_profiles; CREATE TABLE user_profiles ( id SERIAL PRIMARY KEY, user_id BIGINT UNSIGNED, updated_at TIMESTAMP DEFAULT now(), avatar BIGINT UNSIGNED DEFAULT 1, first_name VARCHAR(100) DEFAULT ' ', last_name VARCHAR(100) DEFAULT ' ', gender ENUM ('m', 'f', 'nb', 'ud') DEFAULT 'ud', date_of_birth DATE, country_id BIGINT UNSIGNED, about VARCHAR(350) DEFAULT ' ', is_private BIT DEFAULT 0, INDEX user_name_idx (first_name, last_name), FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE RESTRICT ON UPDATE CASCADE, FOREIGN KEY (avatar) REFERENCES images (id) ON DELETE SET NULL ON UPDATE CASCADE, FOREIGN KEY (country_id) REFERENCES countries (id) ON DELETE SET NULL ON UPDATE CASCADE ); DROP TABLE IF EXISTS messages; CREATE TABLE messages ( id SERIAL PRIMARY KEY, from_user BIGINT UNSIGNED, to_user BIGINT UNSIGNED, created_at TIMESTAMP DEFAULT now(), body_text TEXT NOT NULL, FOREIGN KEY (from_user) REFERENCES users (id) ON DELETE SET NULL ON UPDATE CASCADE, FOREIGN KEY (to_user) REFERENCES users (id) ON DELETE SET NULL ON UPDATE CASCADE ); -- ----------------------------------- TITLES DROP TABLE IF EXISTS titles; CREATE TABLE titles ( id SERIAL PRIMARY KEY, title VARCHAR(100) NOT NULL, original_title VARCHAR(100) DEFAULT ' ', INDEX (title), INDEX (original_title) ); DROP TABLE IF EXISTS title_info; CREATE TABLE title_info ( id SERIAL PRIMARY KEY, title_id BIGINT UNSIGNED, title_type_id BIGINT UNSIGNED DEFAULT 1, poster BIGINT UNSIGNED DEFAULT 2, tagline VARCHAR(200) DEFAULT ' ', synopsis VARCHAR(500) DEFAULT ' ', release_date DATE, rars ENUM ('0+', '6+', '12+', '16+', '18+', 'NR') DEFAULT 'NR', INDEX (release_date), FOREIGN KEY (title_id) REFERENCES titles (id) ON DELETE RESTRICT ON UPDATE CASCADE, FOREIGN KEY (title_type_id) REFERENCES title_types (id) ON DELETE SET NULL ON UPDATE CASCADE, FOREIGN KEY (poster) REFERENCES images (id) ON DELETE SET NULL ON UPDATE CASCADE ); -- ----------------------------------- TITLES ADDITIONAL INFO DROP TABLE IF EXISTS title_country; CREATE TABLE title_country ( id SERIAL PRIMARY KEY, title_id BIGINT UNSIGNED, country_id BIGINT UNSIGNED, FOREIGN KEY (title_id) REFERENCES titles (id) ON DELETE RESTRICT ON UPDATE CASCADE, FOREIGN KEY (country_id) REFERENCES countries (id) ON DELETE SET NULL ON UPDATE CASCADE ); DROP TABLE IF EXISTS title_company; CREATE TABLE title_company ( id SERIAL PRIMARY KEY, title_id BIGINT UNSIGNED, company_id BIGINT UNSIGNED, FOREIGN KEY (title_id) REFERENCES titles (id) ON DELETE RESTRICT ON UPDATE CASCADE, FOREIGN KEY (company_id) REFERENCES companies (id) ON DELETE SET NULL ON UPDATE CASCADE ); DROP TABLE IF EXISTS creators; CREATE TABLE creators ( id SERIAL PRIMARY KEY, first_name VARCHAR(200), last_name VARCHAR(200), date_of_birth DATE, date_of_death DATE DEFAULT NULL, gender ENUM ('m', 'f', 'nb', 'ud') DEFAULT 'ud', photo BIGINT UNSIGNED, country_id BIGINT UNSIGNED, INDEX creator_name_idx (first_name, last_name), FOREIGN KEY (photo) REFERENCES images (id) ON DELETE SET NULL ON UPDATE CASCADE, FOREIGN KEY (country_id) REFERENCES countries (id) ON DELETE SET NULL ON UPDATE CASCADE ); DROP TABLE IF EXISTS cast_and_crew; CREATE TABLE cast_and_crew ( id SERIAL PRIMARY KEY, title_id BIGINT UNSIGNED, role_id BIGINT UNSIGNED, creator_id BIGINT UNSIGNED, FOREIGN KEY (title_id) REFERENCES titles (id) ON DELETE RESTRICT ON UPDATE CASCADE, FOREIGN KEY (role_id) REFERENCES roles (id) ON DELETE SET NULL ON UPDATE CASCADE, FOREIGN KEY (creator_id) REFERENCES creators (id) ON DELETE SET NULL ON UPDATE CASCADE ); -- ----------------------------------- TITLES INFO, INFLUENCED BY USERS DROP TABLE IF EXISTS all_keywords; CREATE TABLE all_keywords ( id SERIAL PRIMARY KEY, user_id BIGINT UNSIGNED, keyword VARCHAR(100) UNIQUE, created_at TIMESTAMP DEFAULT now(), FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE RESTRICT ON UPDATE CASCADE ); DROP TABLE IF EXISTS votes_on_keywords; CREATE TABLE votes_on_keywords ( id SERIAL PRIMARY KEY, title_id BIGINT UNSIGNED, keyword_id BIGINT UNSIGNED NOT NULL, user_id BIGINT UNSIGNED, vote BIT DEFAULT 1, created_at TIMESTAMP DEFAULT now(), FOREIGN KEY (title_id) REFERENCES titles (id) ON DELETE RESTRICT ON UPDATE CASCADE, FOREIGN KEY (keyword_id) REFERENCES all_keywords (id) ON DELETE RESTRICT ON UPDATE CASCADE, FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE RESTRICT ON UPDATE CASCADE ); DROP TABLE IF EXISTS votes_on_genre; CREATE TABLE votes_on_genre ( id SERIAL PRIMARY KEY, title_id BIGINT UNSIGNED, genre_id BIGINT UNSIGNED NOT NULL, user_id BIGINT UNSIGNED, vote BIT, created_at TIMESTAMP DEFAULT now(), FOREIGN KEY (title_id) REFERENCES titles (id) ON DELETE RESTRICT ON UPDATE CASCADE, FOREIGN KEY (genre_id) REFERENCES genres (id) ON DELETE CASCADE ON UPDATE CASCADE, FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE RESTRICT ON UPDATE CASCADE ); DROP TABLE IF EXISTS rating; CREATE TABLE rating ( id SERIAL PRIMARY KEY, title_id BIGINT UNSIGNED, user_id BIGINT UNSIGNED, rating TINYINT UNSIGNED NOT NULL DEFAULT 0, created_at TIMESTAMP DEFAULT now(), updated_at TIMESTAMP DEFAULT now(), INDEX (rating), FOREIGN KEY (title_id) REFERENCES titles (id) ON DELETE RESTRICT ON UPDATE CASCADE, FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE RESTRICT ON UPDATE CASCADE ); DROP TABLE IF EXISTS reviews; CREATE TABLE reviews ( id SERIAL PRIMARY KEY, title_id BIGINT UNSIGNED, user_id BIGINT UNSIGNED, body VARCHAR(500), is_positive BIT DEFAULT 1, created_at TIMESTAMP DEFAULT now(), INDEX (is_positive), FOREIGN KEY (title_id) REFERENCES titles (id) ON DELETE RESTRICT ON UPDATE CASCADE, FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE RESTRICT ON UPDATE CASCADE ); DROP TABLE IF EXISTS votes_on_reviews; CREATE TABLE votes_on_reviews ( id SERIAL PRIMARY KEY, review_id BIGINT UNSIGNED NOT NULL, user_id BIGINT UNSIGNED, vote BIT, created_at TIMESTAMP DEFAULT now(), FOREIGN KEY (review_id) REFERENCES reviews (id) ON DELETE CASCADE ON UPDATE CASCADE, FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE RESTRICT ON UPDATE CASCADE ); -- ----------------------------------- LISTS DROP TABLE IF EXISTS watchlist; CREATE TABLE watchlist ( id SERIAL PRIMARY KEY, title_id BIGINT UNSIGNED, user_id BIGINT UNSIGNED, is_seen BIT DEFAULT 0, created_at TIMESTAMP DEFAULT now(), updated_at TIMESTAMP DEFAULT now(), FOREIGN KEY (title_id) REFERENCES titles (id) ON DELETE RESTRICT ON UPDATE CASCADE, FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE RESTRICT ON UPDATE CASCADE ); DROP TABLE IF EXISTS user_lists; CREATE TABLE user_lists ( id SERIAL PRIMARY KEY, user_id BIGINT UNSIGNED, list_name VARCHAR(50) DEFAULT ' ', description VARCHAR(100) DEFAULT ' ', is_private BIT DEFAULT 0, created_at TIMESTAMP DEFAULT now(), INDEX (list_name), INDEX (is_private), FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE RESTRICT ON UPDATE CASCADE ); DROP TABLE IF EXISTS user_list_items; CREATE TABLE user_list_items ( id SERIAL PRIMARY KEY, list_id BIGINT UNSIGNED NOT NULL, title_id BIGINT UNSIGNED, created_at TIMESTAMP DEFAULT now(), FOREIGN KEY (list_id) REFERENCES user_lists (id) ON DELETE CASCADE ON UPDATE CASCADE, FOREIGN KEY (title_id) REFERENCES titles (id) ON DELETE RESTRICT ON UPDATE CASCADE ); -- ----------------------------------- FOLLOWERS DROP TABLE IF EXISTS follow_user; CREATE TABLE follow_user ( id SERIAL PRIMARY KEY, follower_id BIGINT UNSIGNED NOT NULL, target_id BIGINT UNSIGNED NOT NULL, created_at TIMESTAMP DEFAULT now(), updated_at TIMESTAMP DEFAULT now(), FOREIGN KEY (follower_id) REFERENCES users (id) ON DELETE CASCADE ON UPDATE CASCADE, FOREIGN KEY (target_id) REFERENCES users (id) ON DELETE CASCADE ON UPDATE CASCADE ); DROP TABLE IF EXISTS follow_keyword; CREATE TABLE follow_keyword ( id SERIAL PRIMARY KEY, user_id BIGINT UNSIGNED, keyword_id BIGINT UNSIGNED NOT NULL, created_at TIMESTAMP DEFAULT now(), updated_at TIMESTAMP DEFAULT now(), FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE RESTRICT ON UPDATE CASCADE, FOREIGN KEY (keyword_id) REFERENCES all_keywords (id) ON DELETE CASCADE ON UPDATE CASCADE ); DROP TABLE IF EXISTS follow_genre; CREATE TABLE follow_genre ( id SERIAL PRIMARY KEY, user_id BIGINT UNSIGNED, genre_id BIGINT UNSIGNED NOT NULL, created_at TIMESTAMP DEFAULT now(), updated_at TIMESTAMP DEFAULT now(), FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE RESTRICT ON UPDATE CASCADE, FOREIGN KEY (genre_id) REFERENCES genres (id) ON DELETE CASCADE ON UPDATE CASCADE ); DROP TABLE IF EXISTS follow_list; CREATE TABLE follow_list ( id SERIAL PRIMARY KEY, user_id BIGINT UNSIGNED, list_id BIGINT UNSIGNED NOT NULL, created_at TIMESTAMP DEFAULT now(), updated_at TIMESTAMP DEFAULT now(), FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE RESTRICT ON UPDATE CASCADE, FOREIGN KEY (list_id) REFERENCES user_lists (id) ON DELETE CASCADE ON UPDATE CASCADE ); -- --------------------------------------------------------- -- ----------------------- FUNCTIONS ----------------------- -- --------------------------------------------------------- -- ----------------------------------- GENRE RELEVANCY COUNT function DROP FUNCTION IF EXISTS g_relevancy; DELIMITER // CREATE FUNCTION g_relevancy(t_id INT UNSIGNED, g_id INT UNSIGNED) RETURNS INT DETERMINISTIC BEGIN RETURN (SELECT likes.c - dislikes.c FROM ( SELECT count(vote) AS c FROM votes_on_genre WHERE vote = 1 AND title_id = t_id AND genre_id = g_id ) AS likes JOIN ( SELECT count(vote) AS c FROM votes_on_genre WHERE vote = 0 AND title_id = t_id AND genre_id = g_id ) AS dislikes ); END; // DELIMITER ; -- DROP FUNCTION IF EXISTS g_relevancy; -- ----------------------------------- KEYWORD RELEVANCY COUNT function DROP FUNCTION IF EXISTS k_relevancy; DELIMITER // CREATE FUNCTION k_relevancy(t_id INT UNSIGNED, k_id INT UNSIGNED) RETURNS INT DETERMINISTIC BEGIN RETURN (SELECT likes.c - dislikes.c FROM ( SELECT count(vote) AS c FROM votes_on_keywords WHERE vote = 1 AND title_id = t_id AND keyword_id = k_id ) AS likes JOIN ( SELECT count(vote) AS c FROM votes_on_keywords WHERE vote = 0 AND title_id = t_id AND keyword_id = k_id ) AS dislikes ); END; // DELIMITER ; -- DROP FUNCTION IF EXISTS k_relevancy; -- ----------------------------------- REVIEW RATING function DROP FUNCTION IF EXISTS review_rate; DELIMITER // CREATE FUNCTION review_rate(r_id INT UNSIGNED) RETURNS INT DETERMINISTIC BEGIN RETURN (SELECT likes.c - dislikes.c FROM ( SELECT count(vote) AS c FROM votes_on_reviews WHERE vote = 1 AND review_id = r_id ) AS likes JOIN ( SELECT count(vote) AS c FROM votes_on_reviews WHERE vote = 0 AND review_id = r_id ) AS dislikes ); END; // DELIMITER ; -- DROP FUNCTION IF EXISTS review_rate; -- ----------------------------------- COUNTRIES GENERAL INFO view CREATE OR REPLACE VIEW countries_info AS SELECT c.id as c_id, c.country, tc.c1 AS all_titles, up.c2 AS all_users, cr.c3 AS all_creators FROM countries c LEFT JOIN (SELECT count(title_id) AS c1, country_id FROM title_country GROUP BY country_id ) AS tc ON c.id = tc.country_id LEFT JOIN (SELECT count(user_id) AS c2, country_id FROM user_profiles GROUP BY country_id ) AS up ON c.id = up.country_id LEFT JOIN (SELECT count(id) AS c3, country_id FROM creators GROUP BY country_id ) AS cr ON c.id = cr.country_id GROUP BY c.country ORDER BY c.country; -- DROP VIEW IF EXISTS countries_info; -- ----------------------------------- TITLES & COUNTRIES view CREATE OR REPLACE VIEW titles_and_countries AS SELECT t.id AS t_id, t.title, c.id AS c_id, c.country FROM titles t JOIN title_country tc ON t.id = tc.title_id JOIN countries c ON tc.country_id = c.id ORDER BY t.id; -- ----------------------------------- TITLES & PRODUCTION COMPANIES view CREATE OR REPLACE VIEW titles_and_companies AS SELECT t.id AS t_id, t.title, c.id AS comp_id, c.company FROM titles t JOIN title_company tc ON t.id = tc.title_id JOIN companies c ON tc.company_id = c.id ORDER BY t.id; -- DROP VIEW IF EXISTS titles_and_companies; -- ----------------------------------- TITLES & CREATORS view CREATE OR REPLACE VIEW titles_and_cast AS SELECT t.id AS t_id, t.title, r.id AS r_id, r.role, cr.id AS cr_id, concat_ws(' ', cr.first_name, cr.last_name) AS name, ti.release_date FROM creators cr INNER JOIN cast_and_crew cac ON cr.id = cac.creator_id INNER JOIN titles t ON cac.title_id = t.id INNER JOIN roles r ON cac.role_id = r.id INNER JOIN title_info ti ON t.id = ti.title_id ORDER BY t.id; -- DROP VIEW IF EXISTS titles_and_cast; -- --------------------------------------------------------- -- ----------------------- VIEWS WITH VOTES ---------------- -- --------------------------------------------------------- -- ----------------------------------- GENRES GENERAL INFO view CREATE OR REPLACE VIEW genres_info AS SELECT g.id AS g_id, g.genre, fg.c AS followers, vog.c AS all_titles, vog_r.c AS relevant_titles FROM genres g LEFT JOIN (SELECT count(user_id) AS c, genre_id FROM follow_genre GROUP BY genre_id ) AS fg ON g.id = fg.genre_id LEFT JOIN (SELECT count(title_id) AS c, -- All titles genre_id FROM votes_on_genre GROUP BY genre_id ) AS vog ON g.id = vog.genre_id LEFT JOIN (SELECT count(title_id) AS c, genre_id FROM votes_on_genre WHERE g_relevancy(title_id, genre_id) > 0 GROUP BY genre_id ) AS vog_r ON g.id = vog_r.genre_id ORDER BY g.genre; -- DROP VIEW IF EXISTS genres_info; -- ----------------------------------- TITLES & THEIR GENRES view CREATE OR REPLACE VIEW titles_and_genres AS SELECT t.id AS t_id, t.title, g.id AS g_id, g.genre, g_relevancy(t.id, g.id) AS relevancy FROM titles t LEFT JOIN votes_on_genre vog ON t.id = vog.title_id LEFT JOIN genres g ON vog.genre_id = g.id GROUP BY t.id, g.genre ORDER BY t.id, relevancy DESC; -- DROP VIEW IF EXISTS titles_and_genres; -- ----------------------------------- KEYWORDS GENERAL INFO view CREATE OR REPLACE VIEW keywords_info AS SELECT ak.id AS k_id, ak.keyword, fk.c AS followers, vok.c AS all_titles, vok_r.c AS relevant_titles FROM all_keywords ak LEFT JOIN (SELECT count(user_id) AS c, keyword_id FROM follow_keyword GROUP BY keyword_id ) AS fk ON ak.id = fk.keyword_id LEFT JOIN (SELECT count(title_id) AS c, -- All titles keyword_id FROM votes_on_keywords GROUP BY keyword_id ) AS vok ON ak.id = vok.keyword_id LEFT JOIN (SELECT count(title_id) AS c, -- Relevant titles keyword_id FROM votes_on_keywords WHERE k_relevancy(title_id, keyword_id) > 0 GROUP BY keyword_id ) AS vok_r ON ak.id = vok_r.keyword_id ORDER BY ak.id; -- DROP VIEW IF EXISTS keywords_info; -- ----------------------------------- TITLES & KEYWORDS view CREATE OR REPLACE VIEW titles_and_keywords AS SELECT t.id AS t_id, t.title, ak.id AS k_id, ak.keyword, k_relevancy(t.id, ak.id) AS relevancy FROM titles t LEFT JOIN votes_on_keywords vok ON t.id = vok.title_id LEFT JOIN all_keywords ak ON vok.keyword_id = ak.id GROUP BY t.id, ak.keyword ORDER BY t.id, relevancy DESC; -- DROP VIEW IF EXISTS titles_and_genres; -- ----------------------------------- REVIEWS INFO view CREATE OR REPLACE VIEW reviews_info AS SELECT r.title_id AS t_id, t.title, r.id AS rev_id, r.body, CASE (r.is_positive) WHEN 1 THEN 'positive' WHEN 0 THEN 'negative' END AS mood, review_rate(r.id) AS voted, u.username FROM reviews r JOIN titles t ON r.title_id = t.id JOIN users u ON r.user_id = u.id ORDER BY r.id; -- DROP VIEW IF EXISTS reviews_info; -- --------------------------------------------------------- -- ----------------------- PROFILE VIEWS ------------------- -- --------------------------------------------------------- -- ----------------------------------- TITLES PROFILES view CREATE OR REPLACE VIEW t_profiles AS SELECT t.id AS t_id, t.title, tt.title_type, r.avgr AS rating, r.count AS r_votes, seen.c AS was_seen, to_w.c AS on_watchlist, uli.c AS on_user_lists, r2.c AS reviewed, ti.release_date, ti.rars, t.original_title, ti.poster, ti.tagline, ti.synopsis FROM titles AS t INNER JOIN title_info ti ON t.id = ti.title_id INNER JOIN title_types tt ON tt.id = ti.title_type_id LEFT JOIN (SELECT title_id, round(avg(rating)) AS avgr, count(rating) AS count FROM rating GROUP BY title_id ) AS r ON r.title_id = t.id LEFT JOIN (SELECT count(is_seen) AS c, title_id FROM watchlist WHERE is_seen = 1 GROUP BY title_id ) seen ON seen.title_id = t.id LEFT JOIN (SELECT count(is_seen) AS c, title_id FROM watchlist WHERE is_seen = 0 GROUP BY title_id ) to_w ON to_w.title_id = t.id LEFT JOIN (SELECT count(list_id) AS c, title_id FROM user_list_items GROUP BY title_id ) uli ON t.id = uli.title_id LEFT JOIN (SELECT count(id) AS c, title_id FROM reviews GROUP BY title_id ) r2 ON t.id = r2.title_id ORDER BY t.id; -- DROP VIEW IF EXISTS t_profiles; -- ----------------------------------- USERS PROFILES view CREATE OR REPLACE VIEW u_profiles AS SELECT u.id AS u_id, concat_ws(' ', up.first_name, up.last_name) AS name, u.username, u.phone_number, u.email, up.date_of_birth, TIMESTAMPDIFF(YEAR, up.date_of_birth, NOW()) AS age, CASE (up.gender) WHEN 'm' THEN 'male' WHEN 'f' THEN 'female' WHEN 'nb' THEN 'non-binary' WHEN 'ud' THEN 'undefined' END AS gender, CASE (up.is_private) WHEN 1 THEN 'private' WHEN 0 THEN 'public' END AS account, fu_t.c AS followers, fu_f.c AS following, to_w.c AS to_watch, seen.c AS titles_seen, ul.lists, r.c AS reviews, r2.c AS rated_titles, r2.avg_rating, c.country, up.avatar, up.about FROM users u LEFT JOIN user_profiles up ON u.id = up.user_id LEFT JOIN countries c ON up.country_id = c.id LEFT JOIN (SELECT count((id)) AS c, -- Number of followers target_id FROM follow_user GROUP BY target_id ) fu_t ON u.id = fu_t.target_id LEFT JOIN (SELECT count((id)) AS c, -- Number of users, he/she is following follower_id FROM follow_user GROUP BY follower_id ) fu_f ON u.id = fu_f.follower_id LEFT JOIN (SELECT user_id, count(title_id) AS c FROM watchlist WHERE is_seen = 0 GROUP BY user_id ) to_w ON u.id = to_w.user_id LEFT JOIN (SELECT user_id, count(title_id) AS c FROM watchlist WHERE is_seen = 1 GROUP BY user_id ) seen ON u.id = seen.user_id LEFT JOIN (SELECT count(list_name) AS lists, user_id FROM user_lists GROUP BY user_id ) ul ON u.id = ul.user_id LEFT JOIN (SELECT count(id) AS c, user_id FROM reviews GROUP BY user_id ) r ON u.id = r.user_id LEFT JOIN (SELECT count(id) AS c, round(avg(rating)) AS avg_rating, user_id FROM rating GROUP BY user_id ) r2 ON u.id = r2.user_id ORDER BY u.id; -- DROP VIEW IF EXISTS u_profiles; -- ----------------------------------- CREATORS PROFILES view CREATE OR REPLACE VIEW cr_profiles AS SELECT cr.id AS cr_id, concat_ws(' ', cr.first_name, cr.last_name) AS name, TIMESTAMPDIFF(YEAR, cr.date_of_birth, NOW()) AS age, CASE (cr.gender) WHEN 'm' THEN 'male' WHEN 'f' THEN 'female' WHEN 'nb' THEN 'non-binary' WHEN 'ud' THEN 'undefined' END AS gender, cac.c AS filmography, cr_r.role, cr_r.r_count, cr.date_of_birth, cn.id AS c_id, cn.country FROM creators cr JOIN countries cn ON cr.country_id = cn.id LEFT JOIN (SELECT creator_id, title_id, count(title_id) AS c FROM cast_and_crew GROUP BY creator_id ) cac ON cac.creator_id = cr.id LEFT JOIN (SELECT creator_id, role_id, r.role AS role, count(role_id) AS r_count FROM cast_and_crew JOIN roles r ON cast_and_crew.role_id = r.id GROUP BY creator_id, role_id ORDER BY creator_id, r_count DESC ) AS cr_r ON cr_r.creator_id = cr.id ORDER BY cr.id; -- DROP VIEW IF EXISTS cr_profiles; --------------------------------------------------------- -- ---------------- Titles recommendations ----------------- -- ---------------- for a specific user -------------------- DROP PROCEDURE IF EXISTS offer_titles; DELIMITER // CREATE PROCEDURE offer_titles(IN for_user_id INT) BEGIN -- Titles on the lists the user follows SELECT t.title, rtg.avg_r FROM titles t JOIN user_list_items uli ON uli.title_id = t.id JOIN user_lists ul ON uli.list_id = ul.id JOIN follow_list fl ON fl.list_id = ul.id JOIN (SELECT round(avg(rating)) AS avg_r, title_id FROM rating GROUP BY title_id ) rtg ON rtg.title_id = t.id WHERE fl.user_id = for_user_id UNION -- Titles on the lists of users the user follows SELECT t.title, rtg.avg_r FROM titles t JOIN user_list_items uli ON uli.title_id = t.id JOIN user_lists ul ON ul.id = uli.list_id JOIN follow_user fu ON fu.target_id = ul.user_id JOIN (SELECT round(avg(rating)) AS avg_r, title_id FROM rating GROUP BY title_id ) rtg ON rtg.title_id = t.id WHERE fu.follower_id = for_user_id UNION -- Titles that were highly rated by the users the user follows SELECT t.title, rtg.avg_r FROM titles t JOIN rating r ON r.title_id = t.id JOIN follow_user fu ON fu.target_id = r.user_id JOIN (SELECT round(avg(rating)) AS avg_r, title_id FROM rating GROUP BY title_id ) rtg ON rtg.title_id = t.id WHERE fu.follower_id = for_user_id AND r.rating > 5 UNION -- Titles that received positive reviews from the users the user follows SELECT t.title, rtg.avg_r FROM titles t JOIN reviews r ON r.title_id = t.id JOIN follow_user fu ON fu.target_id = r.user_id JOIN (SELECT round(avg(rating)) AS avg_r, title_id FROM rating GROUP BY title_id ) rtg ON rtg.title_id = t.id WHERE fu.follower_id = for_user_id AND r.is_positive = 1 UNION -- Most relevant titles of the genre the user follows SELECT t.title, rtg.avg_r FROM titles t JOIN votes_on_genre vog ON vog.title_id = t.id JOIN follow_genre fg ON fg.genre_id = vog.genre_id JOIN (SELECT round(avg(rating)) AS avg_r, title_id FROM rating GROUP BY title_id ) rtg ON rtg.title_id = t.id WHERE fg.user_id = for_user_id AND g_relevancy(vog.title_id, vog.genre_id) > 0 UNION -- Most relevant titles with the keywords the user follows SELECT t.title, rtg.avg_r FROM titles t JOIN votes_on_keywords vok ON vok.title_id = t.id JOIN follow_keyword fk ON fk.keyword_id = vok.keyword_id JOIN (SELECT round(avg(rating)) AS avg_r, title_id FROM rating GROUP BY title_id ) rtg ON rtg.title_id = t.id WHERE fk.user_id = for_user_id AND k_relevancy(vok.title_id, vok.keyword_id) > 0 UNION -- Titles on the user's watchlist that he/she hasn't seen yet SELECT t.title, rtg.avg_r FROM titles t JOIN watchlist w ON t.id = w.title_id JOIN (SELECT round(avg(rating)) AS avg_r, title_id FROM rating GROUP BY title_id ) rtg ON rtg.title_id = t.id WHERE w.user_id = for_user_id AND is_seen = 0 ORDER BY rand() LIMIT 10; END // DELIMITER ; -- --------------------------------------------------------- -- ------------ Similar titles on a title page ------------- -- ------------ for any user ------------------------------ DROP PROCEDURE IF EXISTS similar_titles; DELIMITER // CREATE PROCEDURE similar_titles(IN for_title_id INT) BEGIN -- Titles of the same genre SELECT t.title, rtg.avg_r FROM titles t JOIN votes_on_genre vog ON t.id = vog.title_id JOIN (SELECT round(avg(rating)) AS avg_r, title_id FROM rating GROUP BY title_id ) rtg ON rtg.title_id = t.id WHERE t.id <> for_title_id AND vog.genre_id IN (SELECT genre_id FROM votes_on_genre WHERE title_id = for_title_id ) AND g_relevancy(vog.title_id, vog.genre_id) > 0 UNION -- Titles with the same keywords SELECT t.title, rtg.avg_r FROM titles t JOIN votes_on_keywords vok ON t.id = vok.title_id JOIN (SELECT round(avg(rating)) AS avg_r, title_id FROM rating GROUP BY title_id ) rtg ON rtg.title_id = t.id WHERE t.id <> for_title_id AND keyword_id IN (SELECT keyword_id FROM votes_on_keywords WHERE title_id = for_title_id ) AND k_relevancy(vok.title_id, vok.keyword_id) > 0 UNION -- Titles of the same type produced in the same country SELECT t.title, rtg.avg_r FROM titles t JOIN title_info ti ON ti.title_id = t.id JOIN title_country tc ON tc.title_id = t.id JOIN (SELECT round(avg(rating)) AS avg_r, title_id FROM rating GROUP BY title_id ) rtg ON rtg.title_id = t.id WHERE t.id <> for_title_id AND ti.title_type_id IN (SELECT title_type_id FROM title_info WHERE title_id = for_title_id ) AND tc.country_id IN (SELECT country_id FROM title_country WHERE title_id = for_title_id ) UNION -- Titles of the same type directed by the same person SELECT t.title, rtg.avg_r FROM titles t JOIN title_info ti ON ti.title_id = t.id JOIN cast_and_crew cac ON cac.title_id = t.id JOIN (SELECT round(avg(rating)) AS avg_r, title_id FROM rating GROUP BY title_id ) rtg ON rtg.title_id = t.id WHERE t.id <> for_title_id AND ti.title_type_id IN (SELECT title_type_id FROM title_info WHERE title_id = for_title_id ) AND cac.role_id = 3 AND cac.creator_id IN (SELECT creator_id FROM cast_and_crew WHERE title_id = for_title_id ) UNION -- Titles of the same type produced by the same companies SELECT t.title, rtg.avg_r FROM titles t JOIN title_info ti ON ti.title_id = t.id JOIN title_company tc ON t.id = tc.title_id JOIN (SELECT round(avg(rating)) AS avg_r, title_id FROM rating GROUP BY title_id ) rtg ON rtg.title_id = t.id WHERE t.id <> for_title_id AND ti.title_type_id IN (SELECT title_type_id FROM title_info WHERE title_id = for_title_id ) AND tc.company_id IN (SELECT company_id FROM title_company WHERE title_id = for_title_id ) ORDER BY rand() LIMIT 5; END // DELIMITER ; CALL similar_titles(1); -- --------------------------------------------------------- -- ----------------- ADDING A NEW USER --------------------- -- --------------------------------------------------------- DROP PROCEDURE IF EXISTS sp_add_user; DELIMITER // CREATE PROCEDURE sp_add_user(username VARCHAR(50), email VARCHAR(100), phone_number BIGINT, password_hash VARCHAR(100), OUT u_in_status VARCHAR(200)) BEGIN DECLARE _rollback BOOL DEFAULT 0; DECLARE code VARCHAR(100); DECLARE error_string VARCHAR(100); DECLARE last_user_id INT; DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN SET _rollback = 1; GET STACKED DIAGNOSTICS CONDITION 1 code = RETURNED_SQLSTATE, error_string = MESSAGE_TEXT; SET u_in_status := concat('Aborted. Error code: ', code, '. Text: ', error_string); END; START TRANSACTION; INSERT INTO users (username, email, phone_number, password_hash) VALUES (username, email, phone_number, password_hash); SELECT last_insert_id() INTO @last_user_id; INSERT INTO user_profiles (user_id) VALUES (@last_user_id); IF _rollback THEN ROLLBACK; ELSE SET u_in_status := 'OK'; COMMIT; END IF; END // DELIMITER ; -- ----------------------------------- CALL PROCEDURE CALL sp_add_user('mintyneon', 'minty@neon.com', '3337711', '28Jtpmzy', @u_in_status); SELECT @insert_status; -- --------------------------------------------------------- -- ----------------- ADDING A NEW TITLE -------------------- -- --------------------------------------------------------- -- Simply adds an empty row into title_info & titles don't have to be unique DROP PROCEDURE IF EXISTS sp_add_title; DELIMITER // CREATE PROCEDURE sp_add_title(title VARCHAR(100), OUT t_in_status VARCHAR(200)) BEGIN DECLARE _rollback BOOL DEFAULT 0; DECLARE code VARCHAR(100); DECLARE error_string VARCHAR(100); DECLARE last_title_id INT; DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN SET _rollback = 1; GET STACKED DIAGNOSTICS CONDITION 1 code = RETURNED_SQLSTATE, error_string = MESSAGE_TEXT; SET t_in_status := concat('Aborted. Error code: ', code, '. Text: ', error_string); END; START TRANSACTION; INSERT INTO titles (title) VALUES (title); SELECT last_insert_id() INTO @last_title_id; INSERT INTO title_info (title_id) VALUES (@last_title_id); IF _rollback THEN ROLLBACK; ELSE SET t_in_status := 'OK'; COMMIT; END IF; END // DELIMITER ; -- ----------------------------------- CALL PROCEDURE CALL sp_add_title('Oh my Venus', @t_in_status); SELECT @t_in_status;
true
8734415ab881c88c1d4fb8a0ec135ba5db0b6a48
SQL
omeryounus/Oracle-SQL-Queries
/HCM/12-Cuestionarios/12.2-Parametros/LoVPersonName.sql
UTF-8
3,369
3.796875
4
[]
no_license
--Oara hacer esta LoV lo que hice fue ver el WHERE de 1-Empleados_Y_Tareas_Y_Cuestionarios y puse todos esos filtros... --de esta manera me aseguro que me traiga a los assignment number que se ven ahi (NO a tooodos los demás). SELECT distinct PPNF.FULL_NAME, --Lo que muestro. PERA.PERSON_ID --Por lo que comparamos en la query. from PER_ALL_PEOPLE_F PERA, PER_PERSON_NAMES_F PPNF, PER_ALL_ASSIGNMENTS_M ASS, per_periods_of_service PPOS, --Checklists: PER_ALLOCATED_CHECKLISTS PACHECK, PER_ALLOCATED_CHECKLISTS_TL PACHECK_TL, --Tareas: PER_ALLOCATED_TASKS PATASKS, PER_TASKS_IN_CHECKLIST_B TAREAS_QUEST, --Cuestionarios: HRQ_QUESTIONNAIRES_B CUESTIONARIO_B, HRQ_QSTNR_PARTICIPANTS QSTNR_PARTICIP, --Preg y rtas: HRQ_QSTNR_RESPONSES QSTNR_RESP, HRQ_QSTN_RESPONSES QSTN_RESP, HRQ_QSTNR_QUESTIONS QSTNR_QUESTIONS, HRQ_QUESTIONS_B QUESTIONS_B where --PERA Y PPNF: PERA.PERSON_ID = PPNF.PERSON_ID AND PPNF.NAME_TYPE = 'GLOBAL' AND SYSDATE BETWEEN PERA.EFFECTIVE_START_DATE AND PERA.EFFECTIVE_END_DATE AND SYSDATE BETWEEN PPNF.EFFECTIVE_START_DATE AND PPNF.EFFECTIVE_END_DATE --ASS: --ACA DEJO el (+) porque la persona puede no tener asignación: AND PERA.PERSON_ID = ASS.PERSON_ID(+) --AND ASS.PRIMARY_FLAG (+) = 'Y' AND ASS.ASSIGNMENT_STATUS_TYPE (+) = 'ACTIVE' and ASS.PRIMARY_ASSIGNMENT_FLAG (+) = 'Y' AND trunc(SYSDATE) BETWEEN ASS.EFFECTIVE_START_DATE (+) AND ASS.EFFECTIVE_END_DATE (+) --PPOS: AND PERA.person_id = PPOS.person_id AND PPOS.period_of_service_id = ( SELECT MAX(period_of_service_id) FROM per_periods_of_service WHERE person_id = PERA.person_id ) ------------------------------------------------------------------------------------------------------------------------------------------------------------------- --Filtramos solo los que tengan tareas 'COM' y cuestionarios: --Checklists: AND PERA.PERSON_ID = PACHECK.PERSON_ID --Join con PERA. AND PACHECK.ALLOCATED_CHECKLIST_ID = PACHECK_TL.ALLOCATED_CHECKLIST_ID AND PACHECK_TL.LANGUAGE = USERENV ('LANG') --Tareas: AND PACHECK.ALLOCATED_CHECKLIST_ID = PATASKS.ALLOCATED_CHECKLIST_ID --Join con las checklists. AND PATASKS.STATUS = 'COM' --Solo traigo los que completaron los cuestionarios. and PATASKS.TASK_IN_CHECKLIST_ID = TAREAS_QUEST.TASK_IN_CHECKLIST_ID and TAREAS_QUEST.ACTION_TYPE = 'ORA_CHK_QUESTIONNAIRE' --Cuestionarios: AND PATASKS.QUESTIONNAIRE_ID = CUESTIONARIO_B.QUESTIONNAIRE_ID --Join con tasks. AND PACHECK.PERSON_ID = QSTNR_PARTICIP.SUBJECT_ID --Join con checklists. AND CUESTIONARIO_B.QUESTIONNAIRE_ID = QSTNR_PARTICIP.QUESTIONNAIRE_ID AND PATASKS.ALLOCATED_TASK_ID = QSTNR_PARTICIP.PARTICIPANT_ID --Join tarea especifica de la checklist. Este JOIN es solo si la tarea esta completa. Si tambien queremos mostrar tareas pendientes (Estado: 'INI'), entonces no usamos este JOIN. --Que tengan preguntas y rtas (Que el cuestionario esté completo): AND QSTNR_PARTICIP.QSTNR_PARTICIPANT_ID = QSTNR_RESP.QSTNR_PARTICIPANT_ID AND QSTNR_RESP.QSTNR_RESPONSE_ID = QSTN_RESP.QSTNR_RESPONSE_ID and QSTN_RESP.QSTNR_QUESTION_ID = QSTNR_QUESTIONS.QSTNR_QUESTION_ID AND QSTNR_QUESTIONS.QUESTION_ID = QUESTIONS_B.QUESTION_ID order by PPNF.FULL_NAME
true
28aeae779dd0f7d383f401c328a329e327c3c2ec
SQL
santiago1393/OraclePLCode
/PLSQLUtilities.sql
UTF-8
945
2.671875
3
[]
no_license
/* Create Oracle JOB */ begin sys.dbms_scheduler.create_job(job_name => 'JOB_NAME', job_type => 'STORED_PROCEDURE', job_action => 'PROCEDURE_NAME', start_date => to_date('14-09-2014 00:00:00', 'dd-mm-yyyy hh24:mi:ss'), repeat_interval => 'FREQ=DAILY;BYDAY=MON,TUE,WED,THU,FRI;BYHOUR=12,5;BYMINUTE=30;BYSECOND=0', end_date => to_date(null), job_class => 'DEFAULT_JOB_CLASS', enabled => true, auto_drop => false, comments => ''); end; / /* RUN ORACLE JOB */ BEGIN SYS.DBMS_SCHEDULER.RUN_JOB('JOB_NAME'); COMMIT; END; /
true
d1d8a5d8d83a137f1adf9c91b75769885d4cca74
SQL
rnmoge/cards-learner
/Scripts/Create/CreateCategory.sql
UTF-8
320
2.703125
3
[]
no_license
Begin Transaction; Create TABLE MAIN.[Temp_807483443]( [ID] int UNIQUE ,[Name] varchar , Primary Key(ID) ); Insert Into MAIN.[Temp_807483443] ([ID],[Name]) Select [ID],[Name] From MAIN.[Category]; Drop Table MAIN.[Category]; Alter Table MAIN.[Temp_807483443] Rename To [Category]; Commit Transaction;
true
197f23ee782c19717c7c0eff4db403daf13d4247
SQL
ShivrajMohite/ImportData_Excel_To_MySQL
/Database/tbl_excel.sql
UTF-8
2,057
2.9375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.8.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Oct 11, 2018 at 10:18 AM -- Server version: 10.1.33-MariaDB -- PHP Version: 7.2.6 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `test` -- -- -------------------------------------------------------- -- -- Table structure for table `tbl_excel` -- CREATE TABLE `tbl_excel` ( `excel_id` int(11) NOT NULL, `excel_name` varchar(250) NOT NULL, `excel_email` varchar(300) NOT NULL, `excel_phone` int(25) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbl_excel` -- INSERT INTO `tbl_excel` (`excel_id`, `excel_name`, `excel_email`, `excel_phone`) VALUES (1, 'shivraj', 'shivraj@21gmail.com', 0), (2, 'amruta', 'amruta@gmail.com', 0), (3, 'raj', 'raj@gmail.com', 0), (4, 'akshay', 'akshay@gmail.com', 0), (5, 'shivraj', 'shivrajmohite21@gmail.com', 0), (6, 'Amruta', 'amruta@gmail.com', 0), (7, 'Akshay', 'aksh@gmail.com', 0), (8, 'vinay', 'vinay@gmail.com', 0), (9, 'shivraj', 'shivrajmohite21@gmail.com', 0), (10, 'Amruta', 'amruta@gmail.com', 0), (11, 'Akshay', 'aksh@gmail.com', 0), (12, 'vinay', 'vinay@gmail.com', 0), (13, 'Xyz', 'xyz@gmail.com', 0), (14, 'shivraj', 'shivrajmohite21@gmail.com', 0), (15, 'Amruta', 'amruta@gmail.com', 0), (16, 'Akshay', 'aksh@gmail.com', 0), (17, 'vinay', 'vinay@gmail.com', 0), (18, 'Xyz', 'xyz@gmail.com', 0); -- -- Indexes for dumped tables -- -- -- Indexes for table `tbl_excel` -- ALTER TABLE `tbl_excel` ADD PRIMARY KEY (`excel_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `tbl_excel` -- ALTER TABLE `tbl_excel` MODIFY `excel_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
c66f4448e88438a431f432ae0bffaea836735356
SQL
fflch/dados
/Queries/conta_convenios_fin.sql
UTF-8
83
2.5625
3
[]
no_license
SELECT COUNT(DISTINCT codcvn) from CONVENIO where dtadtvcvn = NULL AND stafin = 'S'
true
f7f2521bb22b229c261f85a9f7fc029f3c336ad6
SQL
neil-marcellini/Ideate
/Ideate_SQL/stored_procedures/sp_next_iteration.sql
UTF-8
885
4.3125
4
[]
no_license
DROP PROCEDURE IF EXISTS sp_next_iteration; /* Create a new potential linked to the given iteration */ delimiter // CREATE PROCEDURE sp_next_iteration(idea_id INT, iteration_num int) BEGIN -- get the id of the iteration with the given idea and iteration_num set @iteration_id = ( select Iteration.iteration_id from Iteration where Iteration.idea_id = idea_id and Iteration.iteration_num=iteration_num ); select *, @iteration_id as iteration_id from Iteration, ( select count(*) as total_comments from Comment where Comment.iteration_id = @iteration_id ) as total_comments, ( SELECT ROUND(AVG(potential_difficulty)) AS potential_difficulty, ROUND(AVG(potential_brightness)) AS potential_brightness FROM Potential WHERE Potential.iteration_id = @iteration_id ) as avg_potential where Iteration.iteration_id = @iteration_id limit 1; END // delimiter ;
true
eab90ae774f21c052e2329dc877ff85969039e22
SQL
shanyl2400/xg
/schema/migrate_2020_10_08.sql
UTF-8
405
2.65625
3
[]
no_license
-- 新增角色 INSERT INTO auths (`id`, `name`) values (13,"管理本机构信息"); INSERT INTO roles (`id`, `name`, `created_at`, `updated_at`) values (8,"高级机构账号", now(), now()); insert into role_auths (role_id, auth_id) values(8, 6), (8, 13); -- 增加机构支持角色 UPDATE orgs SET support_role_ids = "1,2,3,4,5,6" WHERE id = 1; UPDATE orgs SET support_role_ids = "7,8" WHERE id != 1;
true
579301e5a9f922413e757a2b64879816427cfab4
SQL
betoben007/member_old
/src/main/resources/sql/world.sql
UTF-8
3,290
3.96875
4
[]
no_license
select * from emp; select * from dept; select count(*) from city; -- totalItem select * from country; select * from countrylanguage; select * from city where countrycode=null 'KOR 의 City' 정보를 출력하세요 select IndepYear,HeadOfState,Population from country where Code = 'KOR'; -- char(10) 255max -- varchar(10) 255max -- longvarchar(1000) -> orcle ==> long, mysql ==> text, mediuntext -- clob -> oracle ==> clob, mysql ==> longtext -- numeric(10, 2) -- decimal(10, 2) -- Timestamp (날짜, 시간) -> oracle ==> date, mysql ==> datetime -- Date (날짜) -- Time (시간) -- bLob > oracle ==> blob, mysql ==> blob, mediunblob, longblob drop table dept; create table dept ( deptno numeric(2) not null, dname varchar(14), loc varchar(13), constraint pk_dept primary key (deptno) ) engine=InnoDB default charset=utf8; --emp drop table emp; create table emp ( empno numeric(4) not null, ename varchar(10), job varchar(9), mgr numeric(4), hiredate datetime, sal numeric(7,2), comm numeric(7,2), deptno numeric(2), constraint pk_emp primary key (empno), constraint fk_deptno foreign key (deptno) references dept(deptno) ) engine=InnoDB default charset=utf8; -- bouns drop table bonus; create table bonus( ename varchar(10) , job varchar(9) , sal numeric, comm numeric ) engine=InnoDB default charset=utf8; -- salgrade drop table salgrade; create table salgrade ( grade numeric, losal numeric, hisal numeric ) engine=InnoDB default charset=utf8; insert into emp ( empno, ename, job ) values ( 1001, '왜안되', 'test' ); select * from city limit 0, 10; -- totalItem select count(*) from city; -- limit start, count ==> start 0, 1, 2 ... -- ? start ==> firstItem - 1 -- ? count ==> lastItem - firstItem + 1 -- 1page 1 - 10 == > DB : 1page 0 - 9 -- 2page 11 - 20 == > DB : 2page 10 - 19 -- 1page select * from city limit 0, 10; -- 2page select * from city limit 10, 10; -- --Member Table 생성 --email xxx@xxx.com (regex) --password 영문 and 숫자 and 6 자리 이상 and 3 자리 이상 반복 -- 암호화(encryption) => MD5, SHA-256 -- drop table member; create table member ( id int not null auto_increment, email varchar(30) not null, password varchar(64) not null, name varchar(12) not null, regdate timestamp not null, constraint member_pk primary key (id, email), constraint member_email_uq unique (email), constraint member_id_uq unique (id) ); alter table member auto_increment=1000; select * from member; insert into member (email, password, name, regdate) values ('xxx2', 'yyyy', 'zzz', '2015/08/12'); select last_insert_id(); --id generator select * from id_generator; drop table id_generator; create table id_generator ( name varchar(20) not null primary key, nextval numeric(10) not null, incval numeric(5) not null ); insert into id_generator (name, nextval, incval) values ('memberId', 10000, 100); select * from member2; drop table member2; create table member2 ( id int not null auto_increment, email varchar(30) not null, password varchar(64) not null, name varchar(12) not null, regdate timestamp not null, constraint member2_pk primary key (id, email), constraint member2_email_uq unique (email), constraint member2_id_uq unique (id) );
true
fae76ce2a95cd99d77614dcaee9cd9d8849fba34
SQL
yenanfei/j2ee
/jwch4/db.sql
UTF-8
527
2.671875
3
[]
no_license
create database if not exists `db_jwdb`; USE `db_jwdb`; CREATE TABLE `tb_student`( `no` int NOT NULL auto_increment, `name` varchar(40) NOT null, `OS` int NOT null, `PC` int NOT null, `DS` int NOT null, PRIMARY KEY (`no`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `tb_message`( `id` int NOT NULL auto_increment, `name` varchar(40) NOT null, `title` varchar(100) NOT null, `messages` varchar(800) NOT null, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
true
71cfc7637e3050ac072fc07b68c0ef895ec05183
SQL
jsb5589/JAVAStudy
/EZJava/DBMS/SCOTT/SCOTT~8-WHERE-NULL.sql
UHC
1,318
4.09375
4
[]
no_license
--NULL ó -- ִ -- ʴ --NULL ϸ NULL ȴ. --ҵ: sal*12 SELECT ename, sal, sal*12 as annsal, comm FROM emp; --Ѽҵ: sal*12+ comm SELECT ename, sal, sal*12+comm as annsal, comm FROM emp; --comm nullΰ SELECT * FROM emp WHERE comm = NULL; -- ڷᰡ ˻ SELECT * FROM emp WHERE comm IS NULL; -- ڷᰡ ˻ --comm null ƴ SELECT * FROM emp WHERE comm != NULL; -- ڷᰡ ˻ SELECT * FROM emp WHERE comm IS NOT NULL; -- ڷᰡ ˻ --AND ڿ IS NULL SELECT * FROM emp WHERE comm IS NULL AND sal > null; --ڷᰡ ˻ --AND : --ǿ1 AND ǿ2 --true AND true -> true --true AND false -> false --true AND NULL -> NULL --NULL AND NULL -> NULL --OR : --ǿ1 OR ǿ2 --true OR true -> true --true OR false -> true --true OR NULL -> true --false OR NULL -> NULL --NULL OR false -> NULL --NULL OR NULL -> NULL SELECT * FROM emp WHERE comm IS NULL OR sal >= 5000; SELECT * FROM emp WHERE comm = NULL OR sal >= 5000; SELECT * FROM emp WHERE sal > 5000 OR comm = NULL; SELECT * FROM emp WHERE sal >= 5000 OR comm = NULL;
true
0aecd9e6557bf5ce93f396c54fe85af585b36073
SQL
fecyberid/oricert
/db/oricert.sql
UTF-8
5,517
2.96875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.7.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Apr 18, 2019 at 10:50 PM -- Server version: 10.1.25-MariaDB -- PHP Version: 5.6.31 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `oricert` -- -- -------------------------------------------------------- -- -- Table structure for table `certificates` -- CREATE TABLE `certificates` ( `c_id` int(11) NOT NULL, `c_name` varchar(500) NOT NULL, `c_programme` varchar(500) NOT NULL, `c_institution` varchar(500) NOT NULL, `c_serial_no` varchar(500) NOT NULL, `c_reg_no` varchar(500) NOT NULL, `c_class` varchar(500) NOT NULL, `c_gender` varchar(255) NOT NULL, `c_grad_year` varchar(255) NOT NULL, `c_image_name` varchar(500) NOT NULL, `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `certificates` -- INSERT INTO `certificates` (`c_id`, `c_name`, `c_programme`, `c_institution`, `c_serial_no`, `c_reg_no`, `c_class`, `c_gender`, `c_grad_year`, `c_image_name`, `date_added`) VALUES (1, 'John Doe', 'Msc Masters', '1', '5555545', '353453', 'First class', 'Male', '2010', 'john_doe_msc_masters_certificate_5555545.jpg', '2019-04-18 20:41:06'); -- -------------------------------------------------------- -- -- Table structure for table `user_o` -- CREATE TABLE `user_o` ( `o_id` int(11) NOT NULL, `o_name` varchar(255) NOT NULL, `o_email` varchar(255) NOT NULL, `o_password` varchar(255) NOT NULL, `o_website` varchar(255) NOT NULL, `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `user_o` -- INSERT INTO `user_o` (`o_id`, `o_name`, `o_email`, `o_password`, `o_website`, `date_added`) VALUES (1, 'Eniola Osabiya', 'eosabiya@gmail.com', '9f1814ab87687a05806d8d69f3769de6', 'https://eniolaosabiya.com', '2019-04-18 18:13:58'), (2, 'Kunle Alimi', 'kunleali@gmail.com', '9f1814ab87687a05806d8d69f3769de6', '', '2019-04-18 18:15:03'), (3, 'Alimi Ademo', 'alimi@gmail.com', '9f1814ab87687a05806d8d69f3769de6', 'https://eniolaosabiya.com', '2019-04-18 20:28:24'); -- -------------------------------------------------------- -- -- Table structure for table `user_u` -- CREATE TABLE `user_u` ( `u_id` int(11) NOT NULL, `u_name` varchar(500) NOT NULL, `u_type` varchar(255) NOT NULL, `u_status` varchar(255) NOT NULL, `u_email` varchar(255) NOT NULL, `u_password` varchar(255) NOT NULL, `u_website` varchar(255) NOT NULL, `u_est_date` varchar(255) NOT NULL, `date_added` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `user_u` -- INSERT INTO `user_u` (`u_id`, `u_name`, `u_type`, `u_status`, `u_email`, `u_password`, `u_website`, `u_est_date`, `date_added`) VALUES (1, 'Federal College of Education', 'College Of Eduction', 'Federal', 'fcetakoka@yahoo.com', '9f1814ab87687a05806d8d69f3769de6', 'https://www.fcetakoka.org', '1967', '2019-04-18 17:14:57'), (2, 'Havard Wilson College of Education', 'College Of Eduction', 'Private', 'provost@havardwilsoncollege.com', '9f1814ab87687a05806d8d69f3769de6', 'http://havardwilsoncollege.com', '1993', '2019-04-18 17:16:56'), (3, 'Air Force Institute of Technology', 'Polytechnic', 'Federal', 'registrar@afit.edu.ng', '9f1814ab87687a05806d8d69f3769de6', 'http://www.afit.edu.ng', '1976', '2019-04-18 17:18:42'), (4, 'Bolmor Polytechnic', 'Polytechnic', 'Private', 'bolmorpolytechnic@yahoo.com', '9f1814ab87687a05806d8d69f3769de6', 'http://www.bpi.edu.nd', '1993', '2019-04-18 17:20:08'), (5, 'Crescent University', 'Polytechnic', 'Private', 'info@crescent-university.edu.ng', '9f1814ab87687a05806d8d69f3769de6', 'http://www.crescent-university.edu.ng', '1982', '2019-04-18 17:21:32'), (6, 'Caleb University', 'University', 'Private', 'info@calebuniversity.edu.ng', '9f1814ab87687a05806d8d69f3769de6', 'http://calebuniversity.edu.ng', '1984', '2019-04-18 17:23:09'), (7, 'Babcock University', 'University', 'Private', 'babcock@infoweb.abs.net', '9f1814ab87687a05806d8d69f3769de6', 'http://infoweb.abs.net', '1969', '2019-04-18 17:25:03'), (8, 'Bowen University', 'University', 'Private', 'info@bowenuniversityeduc.org', '9f1814ab87687a05806d8d69f3769de6', 'http://www.bowenuniversity_edu.org', '1987', '2019-04-18 17:26:44'), (9, 'Covenant University', 'University', 'Private', 'registrar@covenantuniversity.org', '9f1814ab87687a05806d8d69f3769de6', 'http://covenantuniversity.org', '1982', '2019-04-18 17:27:49'); -- -- Indexes for dumped tables -- -- -- Indexes for table `certificates` -- ALTER TABLE `certificates` ADD PRIMARY KEY (`c_id`); -- -- Indexes for table `user_o` -- ALTER TABLE `user_o` ADD PRIMARY KEY (`o_id`); -- -- Indexes for table `user_u` -- ALTER TABLE `user_u` ADD PRIMARY KEY (`u_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `certificates` -- ALTER TABLE `certificates` MODIFY `c_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `user_o` -- ALTER TABLE `user_o` MODIFY `o_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `user_u` -- ALTER TABLE `user_u` MODIFY `u_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
25cc917e32b20d1ae7bda141c6e8b3aa593d7378
SQL
v3551G/Mimic_III
/Exploration/queries.sql
UTF-8
856
3.703125
4
[]
no_license
set search_path to mimiciii; #### ICU Stay View Exploration #### select * from icustay_detail limit 10; select distinct subject_id, count(*) as cnt from icustay_detail group by subject_id order by cnt desc; select * from icustay_detail where subject_id = 13033; #### labs_agg select * from lab_aggs limit 10; #### Cookbook Scripts # age-histogram WITH agetbl AS ( SELECT (extract(DAY FROM ad.admittime - p.dob) + extract(HOUR FROM ad.admittime - p.dob) / 24 + extract(MINUTE FROM ad.admittime - p.dob) / 24 / 60 ) / 365.25 AS age FROM admissions ad INNER JOIN patients p ON ad.subject_id = p.subject_id ) , agebin AS ( SELECT age, width_bucket(age, 15, 100, 85) AS bucket FROM agetbl ) SELECT bucket+15 as age, count(*) FROM agebin GROUP BY bucket ORDER BY bucket;
true
3d69c7c42b3f5529c0cc284628a8166f05f4acb5
SQL
PogadaevEA/takeaway
/user-service/src/main/resources/db/changelog/2021.01.27_create_dish_restaurant_category.sql
UTF-8
520
3.34375
3
[]
no_license
--liquibase formatted sql --changeset Egor Pogadaev:1 drop table if exists dish_restaurant_categories cascade; create table dish_restaurant_categories ( dish_id bigint not null, restaurant_id bigint not null, category_id varchar(25) not null, constraint t_drc_dish_id_fkey foreign key (dish_id) references dishes(id), constraint t_drc_restaurant_id_fkey foreign key (restaurant_id) references restaurants(id), constraint t_drc_category_id_fkey foreign key (category_id) references categories(id) );
true
1bf8d863de8da3613ae40f0f1a0c84b7e096ef36
SQL
asyed9394/Employee_DataAnalysis
/Queries/Rec_07_Stu_Joins_query.sql
UTF-8
517
3.578125
4
[]
no_license
-- First check the data SELECT * FROM players LIMIT 10; SELECT * FROM seasons_stats LIMIT 10; -- Join players with seasons_stats SELECT p.id, p.player, p.height, p.weight, p.college, p.born, s.position, s.tm FROM players as p JOIN seasons_stats as s on p.id = s.player_id; -- Join seasons_stats with players SELECT p.id, p.college, s.year, s.position, s.two_point_percentage, s.fg_percentage, s.ft_percentage, s.ts_percentage FROM players as p JOIN seasons_stats as s on p.id = s.player_id;
true
8fcf1149d254bffa3853775f4e6a4877ef2930a7
SQL
deydrums/master-php
/aprendiendo-sql/09-ejercicios/ejercicio24.sql
UTF-8
330
3.75
4
[]
no_license
/* 24. Listar los encargos con el nombre del coche, el nombre del cliente y el nombre de la ciudad, pero unicamente cuando sean de barcelona */ SELECT e.id, co.modelo, c.nombre AS 'Cliente',c.ciudad FROM encargos e INNER JOIN clientes c ON c.id = e.cliente_id INNER JOIN coches co ON co.id = e.coche_id WHERE ciudad = 'Barcelona';
true
b4dd24ab059ddbd3685b38d97d1dfc51ec4cc555
SQL
Trishachi/cohort3
/src/sql/Exercises/Exercises.sql
UTF-8
1,290
3.734375
4
[]
no_license
/*GROUP BY Challenges */ SELECT staff_id, COUNT(amount), SUM(amount) FROM payment GROUP BY staff_id; SELECT customer_id, SUM(amount) FROM payment GROUP BY customer_id ORDER BY sum(amount) DESC LIMIT 5; /*HAVING Challenges */ SELECT customer_id, COUNT(amount) FROM payment GROUP BY customer_id HAVING COUNT(amount) >= 40; SELECT rating, ROUND(AVG(rental_duration), 2) FROM film GROUP BY rating HAVING AVG(rental_duration) > 5; ----------------- CREATE TABLE -------------------------------- CREATE TABLE account_role( user_id interger NOT NULL role_id interger NOT NULL grant_date Timestamp without time zone, PRIMARY KEY (user_id, role_id), CONSTRAINT account_role_role_id_fkey FOREIGN KEY (role_id) REFERENCES role(role_id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT account_role_user_id_fkey FOREIGN KEY (user_id) REFERENCES account (user_id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION ); ----------------- CREATE TABLE Challenge-------------------------------- CREATE TABLE leads( lead_id serial PRIMARY KEY, firstname VARCHAR(50) NOT NULL, lastname VARCHAR(50) NOT NULL, email VARCHAR(355) UNIQUE NOT NULL, Sigup_date TIMESTAMP NOT NULL, minutes_spent INTEGER NOT NULL ); ----------------- INSERT--------------------------------
true
c1a4a8aa6116bc5c92f44a6dcafd833c5461053a
SQL
crystalatk/jumble_back
/schema.sql
UTF-8
542
2.890625
3
[]
no_license
CREATE TABLE users ( id serial PRIMARY KEY, username varchar(20), password varchar (200), first_name varchar (100), last_name varchar (100), zip_code integer, phone_num text, picture text ); CREATE TABLE favorites ( id serial PRIMARY KEY, date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, user_id integer REFERENCES users (id), job_id text ); CREATE TABLE applied ( id serial PRIMARY KEY, date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, user_id integer REFERENCES users (id), job_id text );
true
693fc0a4bee1f31694b2c011e54fffe9d0130d24
SQL
SJSU272LabS17/Project-Team-15
/HM_db_schema/HM_geekEvents.sql
WINDOWS-1252
6,408
2.96875
3
[]
no_license
DROP TABLE IF EXISTS `events`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `events` ( `EventId` int(20) NOT NULL AUTO_INCREMENT, `EventName` varchar(500) DEFAULT NULL, `EventDescription` varchar(1000) DEFAULT NULL, `EventType` varchar(20) DEFAULT NULL, `OrganizerId` int(11) DEFAULT NULL, `Price` decimal(10,2) DEFAULT NULL, `Qty` int(11) DEFAULT NULL, `EventDate` varchar(50) DEFAULT NULL, `images` varchar(500) DEFAULT NULL, `status` varchar(50) DEFAULT "TEMP", PRIMARY KEY (`EventId`), KEY `FkOrganizerId_idx` (`OrganizerId`), CONSTRAINT `FkOrganizerId` FOREIGN KEY (`OrganizerId`) REFERENCES `user` (`UserId`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8; -- Dump completed on 2016-10-16 23:36:17 insert into events(EventName,EventDescription,EventType,OrganizerId,Price,Qty,EventDate,images,status) values ('Forum on the Road','Forum on the Road is back for a second series of live broadcasts across the Bay Area. During Forums two-hour program at the Computer History Museum, KQED host Michael Krasny will discuss technology and issues facing Silicon Valley.','GEEK',12, 15.0, 10, '2017-10-24 10:00:00','historyMMeusium.png','PERM'); -- for Couple Events page insert into events(EventName,EventDescription,EventType,OrganizerId,Price,Qty,EventDate,images,status) values ('Splatter Date for Two with Chocolates, Champagne, and More at Pinspiration', 'The Splatter Date includes one large canvas or two small canvases, chocolates, and two glasses of champagne.', 'LOVER',12, 71.0, 10, '2017-10-25 10:00:00','SplatterDate.PNG','PERM'); insert into events(EventName,EventDescription,EventType,OrganizerId,Price,Qty,EventDate,images,status) values ('Romantic Couples dinner on the Beach', 'Fall in love again with our private dinner on our beautiful beach.For the ultimate in romantic evenings, allow our talented culinary team to create an unforgettable private candle-lit meal for you under the starscomplete with Couples private label wine, three delectable courses of Caribbeaninspired cuisine and the soothing sounds of the waves lapping onto the beach.', 'LOVER',12, 120.0, 15, '2017-10-28 10:00:00','Romantic-coupledinneronbeach.PNG','PERM'); insert into events(EventName,EventDescription,EventType,OrganizerId,Price,Qty,EventDate,images,status) values ('Delicious Duet (or Couples) Spa Package', 'Kiss your stress goodbye with this tasty package! Start out by spending quality time detoxifying in our infrared sauna. You will then be whisked away to receive a Full Body Dry Brush Exfoliation treatment, a delicious 60 minute Swedish massage using Vivas very own Oh So Coconut-Vanilla Whipped Body Butter, and a hot steam towel treatment.', 'LOVER',12, 15.0, 10, '2017-09-18 10:00:00','spaCouple.jpg','PERM'); insert into events(EventName,EventDescription,EventType,OrganizerId,Price,Qty,EventDate,images,status) values ('Monte Carlo Resort and Casino', 'Monte Carlo Resort and Casino surrounds guests with style on the Las Vegas Strip. The sprawling resort is home to multiple bars and restaurants catering to a host of international tastes. Their welcoming BLVD Plaza is reminiscent of Italian piazzas and makes for an excellent place to shop and mingle. At the end of the day, retire to your room, which is outfitted with an Italian-marble entry and bathroom plus a 40-inch LCD TV.', 'FRIENDS',12, 39.0, 10, '2017-06-9 10:00:00','Monte_Freek.jpg','PERM'); insert into events(EventName,EventDescription,EventType,OrganizerId,Price,Qty,EventDate,images,status) values ('Google I/O conference from 17th May-19th May,2017', 'I/O is an outdoor developer festival with hands-on learning, technical talks, and Googlers on-hand to share their insights, Google I/O is returning for the second year at Shoreline Amphitheatre..', 'GEEK',12, 39.0, 10, '2017-05-17 10:00:00','GoogleIO.jpg','PERM'); insert into events(EventName,EventDescription,EventType,OrganizerId,Price,Qty,EventDate,images,status) values ('BOLLYWOOD NIGHT','Bollywood Night Fun filled night of excitement with a dance floor that will definitely make you stay all night long. Join Party Hearty. Lets Dance whole Night its going to be biggest party in town','FREAK',12, 15.0, 20, '2017-10-24','party1.jpg','PERM'); insert into events(EventName,EventDescription,EventType,OrganizerId,Price,Qty,EventDate,images,status) values ('MIDNIGHT CRUISE ','Take a 3 Hour Cruise aboard the Fume Blanc of Commodore Cruises a 4 million dollar, 340 passanger, luxury vessel. It is a Hudson Steamboat Replica with 3 floors, 2 DJs, and amazing views of the Bay Bridge, Golden Gate Bridge, Nob Hill, Alcatraz, and the Spectacular San Francisco Skyline.','FREAK',12, 25.00, 340, '2017-07-20','cruise.jpg','PERM'); insert into events(EventName,EventDescription,EventType,OrganizerId,Price,Qty,EventDate,images,status) values ('MASQUERADE BALL ','If you have been to our Masquerade Balls, you know how much fun they are. Join us for the night of glamour, music, and dancing as we celebrate at The REDWOOD ROOM inside the iconic San Francisco CLIFT HOTEL!','FREAK',12, 20.00, 25, '2017-08-10','Mask.jpg','PERM'); insert into events(EventName,EventDescription,EventType,OrganizerId,Price,Qty,EventDate,images,status) values ('TREKKING','Jog your way from the crashing surf of Ocean Beach through wooded Lands End, catching stunning views of the Bay and its iconic sights.','ADVENTURE',12, 15.0, 20, '2017-10-24','trekk.jpg','PERM'); insert into events(EventName,EventDescription,EventType,OrganizerId,Price,Qty,EventDate,images,status) values ('SNORKELING ','Set sail from the white shores of Sayulita on a guided snorkeling adventure around the Marietas Islands. Dive into the pristine waters to uncover the amazing world that lies below.','ADVENTURE',12, 20.00, 5, '2017-08-10','snork.jpg','PERM'); insert into events(EventName,EventDescription,EventType,OrganizerId,Price,Qty,EventDate,images,status) values ('RIVER RAFTING ','Have a blast on this two-part tour that combines some wild river rafting with a tour of the Hoover Dam. Paddle down the Colorado River as you work your way toward Willow Beach before wandering through the Hoover Dam on a guide tour.','ADVENTURE',12, 25.0, 30, '2017-07-20','rafting.png','PERM');
true
dfc1d3e106eef208abb36946eb8b8df697f2911f
SQL
nikolovkiril/SoftUni
/SQL/Databases MS SQL-Server/Indices and Data Aggregation/07. Deposits Filter.sql
UTF-8
197
2.875
3
[]
no_license
SELECT DepositGroup , SUM(DepositAmount) AS TotalSum FROM WizzardDeposits WHERE MagicWandCreator LIKE '%Ollivander%' GROUP BY DepositGroup HAVING SUM(DepositAmount) < 150000 ORDER BY TotalSum DESC
true
5a0ab1d6f8a81c0c099c0cb781ddc2b39e121809
SQL
evolentDelight/UC-Merced
/CSE111 - Database Systems/Lab03/8.sql
UTF-8
191
3.3125
3
[]
no_license
select s_name from supplier natural join nation natural join region where r_regionkey = n_regionkey AND n_nationkey = s_nationkey AND r_name = 'ASIA' AND s_acctbal < 10000 order by s_name asc
true
23b148ab7f678f4e0ba7cfc5313a1676032f000c
SQL
mbougie/gibbs
/projects/lem/projects/main/sql/v3/v3_2/block/final/v3_2.block_final_core.sql
UTF-8
646
3.328125
3
[]
no_license
----Description: create table that ONLY contains the non-null values in the nwalt_rc column and are not equal to 11 in nwalt column in block_main table ----NOTE this table is getting the majority ----Query returned successfully: 10122499 rows affected, 691541 ms execution time. CREATE TABLE v3_2.block_core as SELECT block_main.geoid, block_main.block_group, block_main.hectares, block_main.neighbor_list, block_main.nwalt_rc as luc, block_main.biomes as biomes, block_main.lng, block_main.lat, block_main.geom FROM v3_2.block_main ---- WHERE block_main.nwalt_rc IS NOT NULL AND block_main.nwalt NOT IN (11)
true
06348e8561fe2268396a78d3a0074794ad5c3284
SQL
SeoK106/SMWU_2020-1_DBProgramming_project
/sql/InsertBook_res.sql
UTF-8
952
3.78125
4
[]
no_license
CREATE PROCEDURE InsertBook_res( bId IN books.b_id%type, sId IN students.s_id%type, result OUT VARCHAR2 ) IS duplicate_reserve EXCEPTION; nBooks NUMBER; rBooks NUMBER; nReserv NUMBER; BEGIN result:='temp'; nReserv:=0; /*에러 처리2: 이미 자신이 예약한 책에 대해 다시 예약하려고 하는 경우 -> 예약하는 경우에만 확인*/ SELECT COUNT(s_id) INTO rBooks FROM reserve WHERE s_id=sId and b_id=bId; IF(rBooks=1) THEN RAISE duplicate_reserve; END IF; /*다른 사람도 예약하고 있는 경우를 위한 처리*/ SELECT COUNT(s_id) INTO nReserv FROM reserve WHERE b_id=bId; INSERT INTO reserve(b_id,s_id,r_date) VALUES(bId,sId,sysdate()); result:=CONCAT('reserve successfully\n',CONCAT(TO_CHAR(nReserv),' people are waiting this book')); COMMIT; EXCEPTION WHEN duplicate_reserve THEN result:='Already reserved book'; WHEN OTHERS THEN rollback; result:=SQLERRM; END; /
true
952dd8f5861e30d9e22346fe52ab1947a7eb5ef4
SQL
myxland/zishan-admin-java
/src/main/resources/sql/11-15+nx_detection_template+何敏.sql
UTF-8
1,672
3.328125
3
[]
no_license
/* Navicat Premium Data Transfer Source Server : ddwb Source Server Type : MySQL Source Server Version : 80016 Source Host : localhost:3306 Source Schema : zishan Target Server Type : MySQL Target Server Version : 80016 File Encoding : 65001 Date: 13/11/2019 10:07:20 */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for nx_detection_template -- ---------------------------- DROP TABLE IF EXISTS `nx_detection_template`; CREATE TABLE `nx_detection_template` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '基地检测模板', `template_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '模板名称', PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; -- ---------------------------- -- Table structure for nx_detemp_rel -- ---------------------------- DROP TABLE IF EXISTS `nx_detemp_rel`; CREATE TABLE `nx_detemp_rel` ( `template_id` int(11) NOT NULL COMMENT '基地检测模板id', `env_standards_id` int(11) NOT NULL COMMENT '基地检测id', PRIMARY KEY (`template_id`) USING BTREE, INDEX `env_standards_id`(`env_standards_id`) USING BTREE, CONSTRAINT `nx_detemp_rel_ibfk_1` FOREIGN KEY (`template_id`) REFERENCES `nx_detection_template` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `nx_detemp_rel_ibfk_2` FOREIGN KEY (`env_standards_id`) REFERENCES `ddwb_env_standards` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic; SET FOREIGN_KEY_CHECKS = 1;
true
ebe7ad4ba32f4f2fac96e85da6fdca9416c1ebe3
SQL
HannahDilley/SQL-Queries
/12 Top 5 Customers in Top Ten Cities using CTE.sql
UTF-8
1,825
4.53125
5
[]
no_license
WITH top_ten_countries (country) AS ( /*Top Ten Countries*/ SELECT country.country, count(country.country) AS country_count FROM customer INNER JOIN address ON customer.address_id = address.address_id INNER JOIN city ON address.city_id = city.city_id INNER JOIN country ON city.country_id = country.country_id GROUP BY country ORDER BY country_count DESC LIMIT 10 ), top_ten_cities (customer_id, first_name, _last_name, city, country) AS ( /* Cities in Top Ten Countries */ SELECT customer.customer_id, customer.first_name, customer.last_name, city.city, country.country, top_ten_countries.country, COUNT(customer.customer_id) AS customers_per_city FROM customer INNER JOIN address ON customer.address_id = address.address_id INNER JOIN city ON address.city_id = city.city_id INNER JOIN country ON city.country_id = country.country_id INNER JOIN top_ten_countries ON country.country = top_ten_countries.country GROUP BY customer.customer_id, customer.first_name, customer.last_name, city.city, country.country, top_ten_countries.country /*ORDER BY country.country, city.city*/ LIMIT 10 ) SELECT top_ten_cities.customer_id, top_ten_cities.first_name, top_ten_cities.last_name, top_ten_cities.city, top_ten_cities.country, COUNT(payment.amount) AS number_of_items, SUM(payment.amount) AS total_per_customer FROM top_ten_cities /*INNER JOIN customer ON payment.customer_id = customer.customer_id INNER JOIN address ON customer.address_id = address.address_id INNER JOIN city ON address.city_id = city.city_id INNER JOIN country ON city.country_id = country.country_id*/ GROUP BY top_ten_cities.customer_id, top_ten_cities.first_name, top_ten_cities.last_name, top_ten_cities.city, top_ten_cities.country ORDER BY total_per_customer DESC ;
true
f089bef9d0ab5ae8f30127e0ea3dc9bd8a372c16
SQL
lickey10/u_CrimeMapper
/CrimeMapper/Assets/GeoArcMap/ServerFiles/Database/www/geoarcmap_db.sql
UTF-8
7,918
3.125
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.0.10.6 -- http://www.phpmyadmin.net -- -- Host: mysql1.paris1.alwaysdata.com -- Generation Time: Jan 02, 2017 at 04:12 AM -- Server version: 10.1.13-MariaDB -- PHP Version: 5.6.16 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `geoarcmap_db` -- -- -------------------------------------------------------- -- -- Table structure for table `employees` -- CREATE TABLE IF NOT EXISTS `employees` ( `id` int(11) NOT NULL, `date_created` date NOT NULL, `login_name` varchar(64) NOT NULL, `login_pass` varchar(64) NOT NULL, `name` varchar(64) CHARACTER SET utf16 NOT NULL, `organization` varchar(128) CHARACTER SET utf16 NOT NULL, `rank` enum('UNKNOWN','ASSISTANT','EMPLOYEE','DIRECTOR') NOT NULL, `type` enum('UNKNOWN','SERVICE_PROVIDER','CORPORATE','') NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `employees` -- INSERT INTO `employees` (`id`, `date_created`, `login_name`, `login_pass`, `name`, `organization`, `rank`, `type`) VALUES (1, '2016-11-20', 'sbillault', 'sbillault.geoarcmap.2016', 'Serge Billault', 'Indiana Jones Fundation', 'EMPLOYEE', 'CORPORATE'), (2, '2016-11-20', 'fmaestre', 'fmaestre', 'Frank Maestre', 'Indiana Jones Fundation', 'DIRECTOR', 'CORPORATE'); -- -------------------------------------------------------- -- -- Table structure for table `items` -- CREATE TABLE IF NOT EXISTS `items` ( `id` int(11) NOT NULL, `site_id` int(11) NOT NULL, `date_created` date NOT NULL, `date_found` date NOT NULL, `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, `dsc` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, `lat` float NOT NULL, `lng` float NOT NULL, `alt` float NOT NULL, `pic` tinytext NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `id` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `items` -- INSERT INTO `items` (`id`, `site_id`, `date_created`, `date_found`, `name`, `dsc`, `lat`, `lng`, `alt`, `pic`) VALUES (-2032438669, 449928427, '2016-12-16', '2016-12-20', 'Marco Polo', 'Boat lover', 40.8235, -8.27454, 0, 'Spraycan-Rodeo-Girl-by-Banksy.jpg'), (-1951583605, -690055404, '2016-12-16', '2017-01-02', 'Tumb 002', '', -33.201, 19.5615, 0, 'Spraycan-Rodeo-Girl-by-Banksy.jpg'), (-1825484322, -977661270, '2016-12-16', '2016-12-17', 'Cairo', 'Endroit momifiant', 30.04, 31.23, 0, 'Spraycan-Rodeo-Girl-by-Banksy.jpg'), (-1189152073, -690055404, '2016-12-16', '2017-01-02', 'Tumb 003', '', -33.3264, 19.455, 0, 'Spraycan-Rodeo-Girl-by-Banksy.jpg'), (-1121372120, -690055404, '2016-12-16', '2017-01-02', 'Ancient tumbs', 'Burried 200 feet under', -34.1254, 19.5958, 0, 'Spraycan-Rodeo-Girl-by-Banksy.jpg'), (-1081181518, 683164552, '2016-12-16', '2016-12-16', 'Archimedes', 'Killed by a roman soldier before he could invent the computer', 41.0714, 15.3483, 0, 'Spraycan-Rodeo-Girl-by-Banksy.jpg'), (-874688093, -977661270, '2016-12-16', '2016-12-16', 'Embouchure du Nil', 'Ca t en bouche un coin', 30.6092, 30.9885, 0, 'Spraycan-Rodeo-Girl-by-Banksy.jpg'), (-857130750, 999511151, '2016-12-16', '2016-12-17', '221 B Baker Street', 'Sherlock home', 51.917, -1.81961, 0, 'Spraycan-Rodeo-Girl-by-Banksy.jpg'), (-847835301, -690055404, '2016-12-16', '2016-12-16', 'Encore un test', 'Encore un test', -28.8996, 19.6359, 0, 'Spraycan-Rodeo-Girl-by-Banksy.jpg'), (-847256848, -790575242, '2016-12-20', '2016-12-20', 'Paris', 'Capitale de la France', 48.859, 2.34673, 0, 'Spraycan-Rodeo-Girl-by-Banksy.jpg'), (-328739069, 683164552, '2016-12-16', '2016-12-16', 'Botte italienne', 'hmmmmm', 39.6649, 16.1124, 0, 'Spraycan-Rodeo-Girl-by-Banksy.jpg'), (-307757316, 0, '2016-12-19', '2016-12-25', 'L''accent', 'l''espace d''un instant, j''ai cru que je ne trouverais jamais jusqu''à ce que je me rappele de mysqli_real_escape_string', -9.99823, 2.90277, 0, 'Spraycan-Rodeo-Girl-by-Banksy.jpg'), (-145866135, -977661270, '2016-12-16', '2016-12-23', 'Nil', 'Bon pour se beigner si on aime les crocodiles', 26.8845, 31.4883, 0, 'Spraycan-Rodeo-Girl-by-Banksy.jpg'), (153038815, 0, '2016-12-19', '2016-12-25', 'Holé', 'Tout plein d''accents partout comme au mois d''Août', -12.6312, 0.989615, 0, 'Spraycan-Rodeo-Girl-by-Banksy.jpg'), (266178240, -790575242, '2016-12-16', '2016-12-17', 'Corse', 'Pays des vendettas explosives', 42.3402, 9.10188, 0, 'Spraycan-Rodeo-Girl-by-Banksy.jpg'), (1046264067, -790575242, '2016-12-16', '2016-12-16', 'Bretagne', 'Region des chapeaux ronds', 48.3491, -2.96832, 0, 'Spraycan-Rodeo-Girl-by-Banksy.jpg'), (1120557141, -690055404, '2016-12-16', '2017-01-02', 'Tumb 001', '', -33.4876, 20.9429, 0, 'Spraycan-Rodeo-Girl-by-Banksy.jpg'), (1277420719, 449928427, '2016-12-16', '2016-12-20', 'Frontière', 'Taxes', 42.2939, -0.001312, 0, 'Spraycan-Rodeo-Girl-by-Banksy.jpg'), (2109595146, 449928427, '2016-12-16', '2016-12-25', 'Zorro', 'Inventeur du Z Buffer', 39.4635, -5.42938, 0, 'Spraycan-Rodeo-Girl-by-Banksy.jpg'); -- -------------------------------------------------------- -- -- Table structure for table `organizations` -- CREATE TABLE IF NOT EXISTS `organizations` ( `id` int(11) NOT NULL, `date_created` date NOT NULL, `date_funded` date NOT NULL, `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, `dsc` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `organizations` -- INSERT INTO `organizations` (`id`, `date_created`, `date_funded`, `name`, `dsc`) VALUES (1, '2016-11-20', '2001-07-04', 'Indiana Jones Fundation', 'The goal of the Indiana Jones Fundation is to retrieve the Lost Panties Of Lara Croft by any mean deemed necessary'); -- -------------------------------------------------------- -- -- Table structure for table `sites` -- CREATE TABLE IF NOT EXISTS `sites` ( `id` int(11) NOT NULL, `date_created` date NOT NULL, `date_opened` date NOT NULL, `date_closed` date NOT NULL, `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, `dsc` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, `lat` float NOT NULL, `lng` float NOT NULL, `alt` float NOT NULL, `pic` tinytext NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `sites` -- INSERT INTO `sites` (`id`, `date_created`, `date_opened`, `date_closed`, `name`, `dsc`, `lat`, `lng`, `alt`, `pic`) VALUES (-977661270, '2016-12-16', '2016-12-24', '2016-12-24', 'Egypt', 'Pays des pyramides', 26.1985, 28.3307, 0, 'default_site_pic.jpg'), (-790575242, '2016-12-16', '2016-12-16', '2016-12-16', 'France', 'Pays de nos ancetres Gaulois', 46.4118, 2.8405, 0, 'default_site_pic.jpg'), (-690055404, '2016-12-16', '2017-01-01', '2017-01-01', 'South Africa EH-247', 'Tumbs discovered recently between 1987 and 2004', -33.483, 19.627, 0, 'default_site_pic.jpg'), (449928427, '2016-12-16', '2016-12-16', '2016-12-16', 'Spain', 'Hola', 40.8607, -4.20877, 0, 'default_site_pic.jpg'), (683164552, '2016-12-16', '2016-12-21', '2016-12-21', 'Italy', 'Pays des premiere ministres chaudes', 41.9828, 13.9772, 0, 'default_site_pic.jpg'), (999511151, '2016-12-16', '2016-12-16', '2016-12-16', 'England', 'The life of Brian', 52.7876, -1.39401, 0, 'default_site_pic.jpg'), (1787473633, '2016-12-16', '2016-12-16', '2016-12-16', 'Greenwich', 'Prime meridian', 51.4822, -0.005127, 0, 'default_site_pic.jpg'); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
8d1145ac770f7958d6556792f4b21e817c6d0433
SQL
TheRealBilal/sighal
/applimedical/sighal/mdd/creation/createTables.sql
UTF-8
18,371
2.84375
3
[]
no_license
drop table if exists BonEntree; drop table if exists Categorie; drop table if exists Command; drop table if exists DossierPatient; drop table if exists FichePatient; drop table if exists FichePatientDentaire; drop table if exists FichePatientGenerale; drop table if exists Fonction; drop table if exists Fournisseur; drop table if exists Intervenant; drop table if exists Intervention; drop table if exists LigneCommand; drop table if exists Membre_organe_; drop table if exists Module; drop table if exists Patient; drop table if exists Permission; drop table if exists Personne; drop table if exists Personnel; drop table if exists PersonnelService; drop table if exists Produit; drop table if exists Qualification; drop table if exists Rdv; drop table if exists Salle; drop table if exists Service; drop table if exists Soin; drop table if exists SousCategorie; drop table if exists TypeDeSoin; drop table if exists TypeIntervention; drop table if exists document; /*==============================================================*/ /* Table : BonEntree */ /*==============================================================*/ create table BonEntree ( dateEntree datetime, prixGlobal int ); /*==============================================================*/ /* Table : Categorie */ /*==============================================================*/ create table Categorie ( codeCateg int, nomCateg varchar(254), descCateg varchar(254) ); /*==============================================================*/ /* Table : Command */ /*==============================================================*/ create table Command ( dateComand int, dateEntreeSouhaitee int ); /*==============================================================*/ /* Table : DossierPatient */ /*==============================================================*/ create table DossierPatient ( numero int, date_crea_doss datetime, date_maj_doss datetime ); /*==============================================================*/ /* Table : FichePatient */ /*==============================================================*/ create table FichePatient ( type varchar(254), date_crea_fich datetime, date_maj_fich datetime, observation int ); /*==============================================================*/ /* Table : FichePatientDentaire */ /*==============================================================*/ create table FichePatientDentaire; /*==============================================================*/ /* Table : FichePatientGenerale */ /*==============================================================*/ create table FichePatientGenerale ( description varchar(254), domaine varchar(254) ); /*==============================================================*/ /* Table : Fonction */ /*==============================================================*/ create table Fonction ( codeFonction int, nomFonction varchar(254), description varchar(254), active bool ); /*==============================================================*/ /* Table : Fournisseur */ /*==============================================================*/ create table Fournisseur ( adresse int, tel int, raisonSocial int, "desc" int, remarque int ); /*==============================================================*/ /* Table : Intervenant */ /*==============================================================*/ create table Intervenant; /*==============================================================*/ /* Table : Intervention */ /*==============================================================*/ create table Intervention ( idInterv int, dateInterv datetime, dureeInterv int, typeInterv TypeIntervention, descInterv varchar(254) ); /*==============================================================*/ /* Table : LigneCommand */ /*==============================================================*/ create table LigneCommand ( quantite int, prix int ); /*==============================================================*/ /* Table : Membre_organe_ */ /*==============================================================*/ create table Membre_organe_; /*==============================================================*/ /* Table : Module */ /*==============================================================*/ create table Module ( codeModule int, nomModule varchar(254), description varchar(254), active bool ); /*==============================================================*/ /* Table : Patient */ /*==============================================================*/ create table Patient ( matricule int, poid int, taille int, antecedents bool, commentaire varchar(254) ); /*==============================================================*/ /* Table : Permission */ /*==============================================================*/ create table Permission ( codePermission int, description varchar(254), typeDroit int, dateDebut datetime, dateFin datetime ); /*==============================================================*/ /* Table : Personne */ /*==============================================================*/ create table Personne ( id int, nom varchar(254), prenom varchar(254), dateNaiss datetime, adresse varchar(254), tel int, civilite varchar(254) ); /*==============================================================*/ /* Table : Personnel */ /*==============================================================*/ create table Personnel ( matricule int, dateEmb datetime, experience int, salaire int ); /*==============================================================*/ /* Table : PersonnelService */ /*==============================================================*/ create table PersonnelService ( isServiceChef bool ); /*==============================================================*/ /* Table : Produit */ /*==============================================================*/ create table Produit ( codeProd int, nomProd varchar(254), descProd varchar(254), dateFabric datetime, dateExpiration datetime, nb_de_util int, quantite int, stockAlert int, quantiteSortie int, dateSortie datetime ); /*==============================================================*/ /* Table : Qualification */ /*==============================================================*/ create table Qualification ( nom varchar(254), codeQualif int, descQualif int ); /*==============================================================*/ /* Table : Rdv */ /*==============================================================*/ create table Rdv ( numRdv int, datePriseRdv datetime, dateRdv int, etat __enumeration__EtatRdv ); /*==============================================================*/ /* Table : Salle */ /*==============================================================*/ create table Salle ( numSalle bigint, nomSalle varchar(254) ); /*==============================================================*/ /* Table : Service */ /*==============================================================*/ create table Service ( serviceId int, nom varchar(254), description varchar(254) ); /*==============================================================*/ /* Table : Soin */ /*==============================================================*/ create table Soin ( identifient varchar(254), typeSoin varchar(254), descriptionSoin int ); /*==============================================================*/ /* Table : SousCategorie */ /*==============================================================*/ create table SousCategorie ( codeSousCat int, nomSousCat varchar(254), descSousCat varchar(254) ); /*==============================================================*/ /* Table : TypeDeSoin */ /*==============================================================*/ create table TypeDeSoin ( codeType varchar(254), nomType varchar(254), categorieType int, descriptionType int ); /*==============================================================*/ /* Table : TypeIntervention */ /*==============================================================*/ create table TypeIntervention ( codeTypeInterv varchar(254), nomTypeInterv varchar(254), descTypeInterv varchar(254) ); /*==============================================================*/ /* Table : document */ /*==============================================================*/ create table document ( Type varchar(254), nomDoc varchar(254), path varchar(254) ); alter table Association_39 add constraint FK_Association_39 foreign key () references Salle on delete restrict on update restrict; alter table Association_39 add constraint FK_Association_39 foreign key () references Service on delete restrict on update restrict; alter table Association_40 add constraint FK_Association_40 foreign key () references Fonction on delete restrict on update restrict; alter table Association_40 add constraint FK_Association_40 foreign key () references Service on delete restrict on update restrict; alter table BonEntree add constraint FK_Association_30 foreign key () references Command on delete restrict on update restrict; alter table BonEntree add constraint FK_Association_5 foreign key () references Command on delete restrict on update restrict; alter table Categorie add constraint FK_Association_1 foreign key () references SousCategorie on delete restrict on update restrict; alter table Command add constraint FK_Association_6 foreign key () references Fournisseur on delete restrict on update restrict; alter table DossierPatient add constraint FK_Association_8 foreign key () references Patient on delete restrict on update restrict; alter table DossierPatient add constraint FK_Association_9 foreign key () references FichePatient on delete restrict on update restrict; alter table FichePatient add constraint FK_Association_23 foreign key () references Personnel on delete restrict on update restrict; alter table FichePatient add constraint FK_Association_32 foreign key () references Intervention on delete restrict on update restrict; alter table FichePatient add constraint FK_Association_37 foreign key () references Soin on delete restrict on update restrict; alter table FichePatientDentaire add constraint FK_Association_14 foreign key () references Membre_organe_ on delete restrict on update restrict; alter table FichePatientDentaire add constraint FK_Generalisation_4 foreign key () references FichePatient on delete restrict on update restrict; alter table FichePatientGenerale add constraint FK_Association_26 foreign key () references __enumeration__Domaine on delete restrict on update restrict; alter table FichePatientGenerale add constraint FK_Association_36 foreign key () references Soin on delete restrict on update restrict; alter table FichePatientGenerale add constraint FK_Generalisation_5 foreign key () references FichePatient on delete restrict on update restrict; alter table Fonction add constraint FK_Association_12 foreign key () references Permission on delete restrict on update restrict; alter table Fonction add constraint FK_Association_15 foreign key () references Personnel on delete restrict on update restrict; alter table Intervenant add constraint FK_Association_25 foreign key () references Rdv on delete restrict on update restrict; alter table Intervenant add constraint FK_Generalisation_3 foreign key () references Personnel on delete restrict on update restrict; alter table Intervention add constraint FK_Association_16 foreign key () references Intervenant on delete restrict on update restrict; alter table Intervention add constraint FK_Association_20 foreign key () references Rdv on delete restrict on update restrict; alter table Intervention add constraint FK_Association_32 foreign key () references FichePatient on delete restrict on update restrict; alter table LigneCommand add constraint FK_Association_4 foreign key () references Command on delete restrict on update restrict; alter table LigneCommand add constraint FK_Association_4 foreign key () references Produit on delete restrict on update restrict; alter table Membre_organe_ add constraint FK_Association_14 foreign key () references FichePatientDentaire on delete restrict on update restrict; alter table Membre_organe_ add constraint FK_Association_34 foreign key () references Soin on delete restrict on update restrict; alter table Module add constraint FK_Association_11 foreign key () references Permission on delete restrict on update restrict; alter table Patient add constraint FK_Association_24 foreign key () references Rdv on delete restrict on update restrict; alter table Patient add constraint FK_Generalisation_2 foreign key () references Personne on delete restrict on update restrict; alter table Permission add constraint FK_Association_10 foreign key () references __enumeration___Droit on delete restrict on update restrict; alter table Personnel add constraint FK_Association_27 foreign key () references DossierPatient on delete restrict on update restrict; alter table Personnel add constraint FK_Association_29 foreign key () references Patient on delete restrict on update restrict; alter table Personnel add constraint FK_Generalisation_1 foreign key () references Personne on delete restrict on update restrict; alter table PersonnelService add constraint FK_Association_38 foreign key () references Personnel on delete restrict on update restrict; alter table PersonnelService add constraint FK_Association_38 foreign key () references Service on delete restrict on update restrict; alter table Produit add constraint FK_Association_3 foreign key () references Personnel on delete restrict on update restrict; alter table Qualification add constraint FK_Association_7 foreign key () references Personnel on delete restrict on update restrict; alter table Rdv add constraint FK_Association_17 foreign key () references Personnel on delete restrict on update restrict; alter table Salle add constraint FK_Association_21 foreign key () references Rdv on delete restrict on update restrict; alter table Salle add constraint FK_Association_22 foreign key () references Intervention on delete restrict on update restrict; alter table Soin add constraint FK_Association_31 foreign key () references TypeDeSoin on delete restrict on update restrict; alter table Soin add constraint FK_Association_33 foreign key () references FichePatientDentaire on delete restrict on update restrict; alter table SousCategorie add constraint FK_Association_2 foreign key () references Produit on delete restrict on update restrict; alter table TypeDeSoin add constraint FK_Association_35 foreign key () references Soin on delete restrict on update restrict; alter table TypeIntervention add constraint FK_Association_19 foreign key () references Intervention on delete restrict on update restrict; alter table __enumeration__EtatRdv add constraint FK_Association_18 foreign key () references Rdv on delete restrict on update restrict; alter table document add constraint FK_Association_28 foreign key () references FichePatient on delete restrict on update restrict;
true
d25c24061f4f4c75f26cb22381be4f19128a082f
SQL
murphyAk/TechJobsPersistent
/TechJobsPersistent/queries.sql
UTF-8
419
4.15625
4
[]
no_license
--Part 1 SELECT COLUMN_NAME, DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'jobs'; --Part 2 SELECT Name, Location FROM employers WHERE Location = "St. Louis City"; --Part 3 SELECT skills.Name AS "Skill name", skills.Description, jobs.Name AS "Job name" FROM skills INNER JOIN jobskills ON Skills.Id = jobskills.SkillId INNER JOIN jobs ON jobskills.JobId = jobs.Id ORDER BY skills.Description ASC;
true
3917c81cb9d892273c8c9a1b0531171e467bb630
SQL
amirizad/healthepetz
/db/schema.sql
UTF-8
3,050
3.484375
3
[]
no_license
create database healthepetz_db; use healthepetz_db; create table users ( id integer(11) auto_increment not null, username varchar(255) not null, email varchar(255) not null, password varchar(20) not null, role varchar(255) not null default 'user', createdAt timestamp not null, updatedAt timestamp not null, primary key (id) ); #drop table owners; create table owners( id integer(11) auto_increment not null, userId integer(11) not null, owner_fname varchar(50) not null, owner_lname varchar(100) not null, owner_dob date, owner_sex varchar(1), address varchar(100), city varchar(100), state varchar(2), zip varchar(10), phone varchar(15), fax varchar(15), createdAt timestamp not null, updatedAt timestamp not null, primary key (id), key userId (userId), constraint fk_user_id_users foreign key (userId) references users (id) ); #drop table pets; create table pets ( id integer(11) auto_increment not null, ownerId integer(11) not null, pet_name varchar(50) not null, pet_type varchar(50) not null, pet_breed varchar(100) not null, pet_color varchar(50) not null, license_no varchar(25) not null, microchip_no varchar(25) not null, insur_name varchar(100), insur_id varchar(25), insur_phone varchar(15), pet_dob date, pet_dod date, pet_age integer(11), pet_sex integer(11), spayed_neutered_ind boolean not null default 0, pet_image_url varchar(255), cond1 varchar(255), cond2 varchar(255), cond3 varchar(255), med1 varchar(255), med2 varchar(255), med3 varchar(255), vet1_name varchar(255), vet1_specialty varchar(100), vet1_address varchar(100), vet1_city varchar(100), vet1_state varchar(2), vet1_zip varchar(10), vet1_phone varchar(15), vet1_email varchar(255), vet1_fax varchar(15), vet2_name varchar(255), vet2_specialty varchar(100), vet2_address varchar(100), vet2_city varchar(100), vet2_state varchar(2), vet2_zip varchar(10), vet2_phone varchar(15), vet2_email varchar(255), vet2_fax varchar(15), createdAt timestamp not null, updatedAt timestamp not null, primary key (id), key ownerId (ownerId), constraint fk_ownesId_owners foreign key (ownerId) references owners (id) ); #drop table medical_history; create table medical_history ( id integer(11) auto_increment not null, petId integer(11) not null, prov_name varchar(255) not null, cond1 varchar(255), svc_dt date not null, total_billed_amt decimal(11,2) not null default 0, total_paid_amt decimal(11,2) not null default 0, notes varchar(500), doc_type varchar(50), doc_image_url varchar(255), createdAt timestamp not null, updatedAt timestamp not null, primary key (id), key petId (petId), constraint fk_petId_pets foreign key (petId) references pets (id) ); #drop table vaccinations; create table vaccinations ( id integer(11) auto_increment not null, petId integer(11) not null, vacc_name varchar(255), last_vacc_dt date not null, next_vacc_dt date, vacc_image_url varchar(255), createdAt timestamp not null, updatedAt timestamp not null, primary key (id), key petsId (petId), constraint fk_vacc_petId_pets foreign key (petId) references pets (id) );
true
a9eb0331b8d0847e7483abc64254735b4c58bb51
SQL
JulioFonseca/Laravel_teste_pratico
/banco de dados/bd_sistema-crud.sql
UTF-8
2,893
2.84375
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Tempo de geração: 15-Mar-2021 às 19:06 -- Versão do servidor: 10.4.17-MariaDB -- versão do PHP: 8.0.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Banco de dados: `bd_sistema-crud` -- -- -------------------------------------------------------- -- -- Estrutura da tabela `usuarios` -- CREATE TABLE `usuarios` ( `id` bigint(20) UNSIGNED NOT NULL, `nome` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `cpf` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `telefone` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `senha` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `data` date NOT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Extraindo dados da tabela `usuarios` -- INSERT INTO `usuarios` (`id`, `nome`, `cpf`, `telefone`, `senha`, `data`, `remember_token`, `created_at`, `updated_at`) VALUES (4, 'Samira Lemos', '689.272.676-89', '(85) 2688-9104', 'asdfmlol', '2003-05-14', NULL, '2021-03-15 02:49:02', '2021-03-15 19:01:26'), (7, 'Maria Julia', '135.691.973-10', '(85) 98373-5327', 'hg6dw8j888', '2001-01-17', NULL, '2021-03-15 17:56:08', '2021-03-15 17:56:08'), (8, 'Pedro henrique', '988.262.703-09', '(88) 99837-8675', 'GJ67vv8', '1989-09-27', NULL, '2021-03-15 18:01:41', '2021-03-15 18:01:41'), (9, 'Heloise Clarice da Paz', '817.242.676-39', '(95) 99381-8809', '7gh8h7uhg7', '1997-07-17', NULL, '2021-03-15 18:27:26', '2021-03-15 18:27:26'), (10, 'Filipe Augusto', '416.641.023-70', '(85) 99415-8306', 'SFujn78Ty', '2004-07-13', NULL, '2021-03-15 18:33:05', '2021-03-15 18:33:05'), (11, 'Danilo Nelson', '865.276.843-98', '(88) 99938-2646', 'SHijN78', '2001-06-12', NULL, '2021-03-15 20:04:08', '2021-03-15 20:05:07'), (12, 'Davi Vitor', '033.368.513-00', '(85) 98108-3350', 'H78b8vgn', '1997-05-07', NULL, '2021-03-15 20:56:26', '2021-03-15 20:56:26'); -- -- Índices para tabelas despejadas -- -- -- Índices para tabela `usuarios` -- ALTER TABLE `usuarios` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `usuarios_cpf_unique` (`cpf`); -- -- AUTO_INCREMENT de tabelas despejadas -- -- -- AUTO_INCREMENT de tabela `usuarios` -- ALTER TABLE `usuarios` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
e07499dcfb611243480a5fc0a08f8cb723a14632
SQL
devaraujstein/Hotel-System
/Scripts/BancoHotel2.sql
UTF-8
3,968
3.375
3
[]
no_license
-- MySQL Script generated by MySQL Workbench -- Mon Jun 4 15:55:57 2018 -- Model: New Model Version: 1.0 -- MySQL Workbench Forward Engineering SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES'; -- ----------------------------------------------------- -- Schema BancoHoteleiro -- ----------------------------------------------------- -- ----------------------------------------------------- -- Schema BancoHoteleiro -- ----------------------------------------------------- CREATE SCHEMA IF NOT EXISTS `BancoHoteleiro` DEFAULT CHARACTER SET utf8 ; USE `BancoHoteleiro` ; -- ----------------------------------------------------- -- Table `BancoHoteleiro`.`tb_quartos` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `BancoHoteleiro`.`tb_quartos` ( `id_quartos` INT NOT NULL AUTO_INCREMENT, `numero` VARCHAR(4) NOT NULL, `andar` VARCHAR(3) NOT NULL, `descricao` VARCHAR(255) NOT NULL, `caracteristicas` VARCHAR(350) NULL, `preco_diaria` DECIMAL(7,2) NOT NULL, `estado` VARCHAR(15) NOT NULL, `tipo_quarto` VARCHAR(30) NOT NULL, PRIMARY KEY (`id_quartos`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `BancoHoteleiro`.`tb_clientes` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `BancoHoteleiro`.`tb_clientes` ( `id_cliente` INT NOT NULL AUTO_INCREMENT, `nome_cliente` VARCHAR(45) NOT NULL, `tipo_documento` VARCHAR(45) NOT NULL, `num_documento` VARCHAR(45) NOT NULL, `telefone` VARCHAR(45) NULL, `email` VARCHAR(45) NULL, `rua` VARCHAR(100) NULL, `numero_casa` VARCHAR(20) NULL, `bairro` VARCHAR(100) NULL, PRIMARY KEY (`id_cliente`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `BancoHoteleiro`.`tb_funcionarios` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `BancoHoteleiro`.`tb_funcionarios` ( `id_funcionario` INT NOT NULL AUTO_INCREMENT, `nome` VARCHAR(50) NOT NULL, `cpf` VARCHAR(20) NOT NULL, `rua` VARCHAR(100) NULL, `numero_casa` VARCHAR(10) NULL, `bairro` VARCHAR(100) NULL, `num_car_trab` VARCHAR(20) NOT NULL, `data_nascimento` VARCHAR(20) NOT NULL, `salario` DECIMAL(7,2) NOT NULL, `data_entrada` VARCHAR(20) NOT NULL, PRIMARY KEY (`id_funcionario`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `BancoHoteleiro`.`tb_produtos` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `BancoHoteleiro`.`tb_produtos` ( `id_produtos` INT NOT NULL AUTO_INCREMENT, `nome` VARCHAR(50) NOT NULL, `tipo` VARCHAR(50) NOT NULL, `quantidade` INT NOT NULL, `preco_uni` DECIMAL(7,2) NOT NULL, `observacao` VARCHAR(100) NULL, PRIMARY KEY (`id_produtos`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `BancoHoteleiro`.`tb_pagamentos` -- ----------------------------------------------------- CREATE TABLE IF NOT EXISTS `BancoHoteleiro`.`tb_pagamentos` ( `id_pagamento` INT NOT NULL AUTO_INCREMENT, `id_clientes` INT NOT NULL, `id_quartos` INT NOT NULL, `dias_hospedado` INT NOT NULL, `total_cobrado` DECIMAL(7,2) NOT NULL, PRIMARY KEY (`id_pagamento`), INDEX `fk_clientes_pag_idx` (`id_clientes` ASC), INDEX `fk_quartos_pag_idx` (`id_quartos` ASC), CONSTRAINT `fk_clientes_pag` FOREIGN KEY (`id_clientes`) REFERENCES `BancoHoteleiro`.`tb_clientes` (`id_cliente`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_quartos_pag` FOREIGN KEY (`id_quartos`) REFERENCES `BancoHoteleiro`.`tb_quartos` (`id_quartos`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
true
98d791fddd529314704a3b214b4231bc3c54a207
SQL
rochamp2540/Scan-Tracking
/127_0_0_1.sql
UTF-8
2,116
3.0625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.9.0.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Sep 28, 2020 at 01:12 PM -- Server version: 10.4.6-MariaDB -- PHP Version: 7.3.9 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `test_pta` -- CREATE DATABASE IF NOT EXISTS `test_pta` DEFAULT CHARACTER SET utf32 COLLATE utf32_general_ci; USE `test_pta`; -- -------------------------------------------------------- -- -- Table structure for table `pending` -- CREATE TABLE `pending` ( `id` varchar(12) NOT NULL, `penaddress` text DEFAULT NULL, `penstatus` text DEFAULT NULL, `delivere` text DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf32; -- -- Dumping data for table `pending` -- INSERT INTO `pending` (`id`, `penaddress`, `penstatus`, `delivere`) VALUES ('100020003000', '12/34 Sathon Rd. Yannawa Bangkok 10100, Thailand\r\n', 'Delivery', 'in 3 days'), ('123456789012', '34/5-6 Soi Chareenraj 20 Charernraj Rd. Yannawa \r\nBangkok 10100, Thailand', 'Delivery', 'in 2 hours'), ('135790246802', '35/100 Noble Condo, Phayathai Rd. Bangkok, Thailand\r\n', 'Pickup', 'in 1 day'); -- -------------------------------------------------------- -- -- Table structure for table `scanned` -- CREATE TABLE `scanned` ( `id` varchar(12) NOT NULL, `scanaddress` text NOT NULL, `scanstatus` text NOT NULL, `delivere` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf32; -- -- Indexes for dumped tables -- -- -- Indexes for table `pending` -- ALTER TABLE `pending` ADD PRIMARY KEY (`id`); -- -- Indexes for table `scanned` -- ALTER TABLE `scanned` ADD PRIMARY KEY (`id`); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
d07a1ef3e3616f624dd85538b37e3d0e3956cec9
SQL
xittz/PlayREST
/conf/evolutions/default/1.sql
UTF-8
540
2.9375
3
[ "CC0-1.0" ]
permissive
# --- !Ups create table "users" ( "id" bigint generated by default as identity(start with 1) not null primary key, "username" varchar not null, "password" varchar not null, "is_deleted" bit not null ); insert into "users" ("username", "password", "is_deleted") values ('xittz', '1234', 0); insert into "users" ("username", "password", "is_deleted") values ('admin', 'weqweq', 0); insert into "users" ("username", "password", "is_deleted") values ('iwbbtt', 'weq4234234', 0); # --- !Downs drop table "users" if exists;
true
8f3d618237b8cb2e7a3f4a7601e4c25ab2277af6
SQL
mk374/JustForPlay
/insertstatements.sql
UTF-8
6,076
2.9375
3
[]
no_license
--populating sample zip_code -- populating sample users; number uids represent emails for now insert into ruser values('0', 'Animated Andy', 'password123', 'I talk a lot, and really fast', 27708); insert into ruser values('1', 'Ballistic Ben', 'password124', 'I am libertarian!', 27708); insert into ruser values('2', 'Sadistic Sammy', 'password125', 'My favorite color is blue', 27708); insert into ruser values('3', 'Emo Tommy', 'password126', 'I hate everything happy and everyone hates me' , 27708); insert into ruser values('4', 'Amphibious Abby', 'password127', 'Not sure why Im on here', 27708); insert into ruser values('5', 'Mellow Minsoo', 'password128', 'Bro!', 27705); insert into ruser values('6', 'Catastrophic Claire', 'password129', 'Does this picture make my face look fat?', 27705); insert into ruser values('7', 'Elephant Elijah', 'password130', 'I sometimes lay on the floor and pretend Im a carrot', 27708); insert into ruser values('8', 'Needy Nicholas', 'password131', 'I play guitar sometimes', 27708); insert into ruser values('9', 'Random Ruth', 'password132', 'Still not over my ex-boyfriend', 27708); -- -- populating sample community -- insert into community values('Music', 'Those who enjoy going to concerts with friends or want to join a band'); -- insert into community values('Animals', 'Like to look at animals? Hunt? Talk about biology? Heres your group!'); -- insert into community values('Games', 'Board games, tabletop RPG, online games, we got them all'); -- insert into community values('Sports', 'Whoever wants to watch or play'); -- insert into community values('Nightlife', 'What came before part b? Partaaaaaaaaay!'); -- -- populating sample subcommunity -- insert into subcommunity values('Music', 'Playing together', 'Looking for a bass player'); -- insert into subcommunity values('Animals', 'Birdwatching', 'Some great parks around that we can check out!'); -- insert into subcommunity values('Games', 'Dungeons and Dragons', 'Looking for a campaign'); -- insert into subcommunity values('Sports', 'Football', 'Those who enjoy watching the NFL on weekends'); -- insert into subcommunity values('Nightlife', 'Trivia Nights', 'Theres always a trivia night somewhere!'); -- insert into subcommunity values('Nightlife', 'Bar hopping', 'Hit those Durham bars, usually Friday/Saturday nights'); -- populating sample GROUPS insert into groups values('a', 'Bluegrass Musicians', 'Music', 27708, 'private', 'Looking for a bass player -- auditions coming soon!'); insert into groups values('b', 'Animal Lovers', 'Animals', 27708, 'public', 'We stalk Nugget and post updates about where she is'); insert into groups values('c', 'Any games for fun!', 'Games', 27708, 'private', 'Board game fans at Duke, raise your hands!'); insert into groups values('d', 'PATRIOTS FANS ONLY', 'Sports', 27705, 'public', 'Duke football game watch parties'); insert into groups values('e', 'Trivial Players', 'Nightlife', 27708, 'public', 'We attend Krafthouse Trivia night every Thursday night at 8pm!'); -- populating sample members insert into members values('1', 'a', TRUE); insert into members values('1', 'c'); insert into members values('2', 'd', TRUE); insert into members values('2', 'e'); insert into members values('6', 'a', TRUE); insert into members values('7', 'b', TRUE); insert into members values('8', 'a', TRUE); insert into members values('8', 'c', TRUE); insert into members values('8', 'd', TRUE); insert into members values('8', 'e'); --populating sample Events insert into events values('b', '#a1', 'Talking about animals!', '7', 'West Union', '2019-10-09', '20:00:00', 'public'); insert into events values('a', '#a2', 'First Practice', '6', 'Biddle', '2019-11-10', '12:00:00', 'private'); insert into events values('e', '#a3', 'Marvel Trivia', '2', 'Krafthouse', '2019-12-10', '12:00:00', 'public'); --populating sample attending insert into attending values('#a3', '0'); insert into attending values('#a3', '1'); insert into attending values('#a3', '2'); insert into attending values('#a3', '3'); insert into attending values('#a3', '4'); insert into attending values('#a3', '5'); insert into attending values('#a3', '6'); insert into attending values('#a3', '7'); insert into attending values('#a3', '8'); insert into attending values('#a2', '6'); insert into attending values('#a2', '1'); insert into attending values('#a1', '7'); -- -- populating sample requests -- insert into requests values('1', 'a', '#b1'); -- insert into requests values('1', 'c', '#b2'); -- insert into requests values('2', 'd', '#b3'); -- insert into requests values('2', 'e', '#b4'); -- insert into requests values('6', 'a', '#b5'); -- insert into requests values('7', 'b', '#b6'); -- insert into requests values('8', 'a', '#b7'); -- insert into requests values('8', 'c', '#b8'); -- insert into requests values('8', 'd', '#b9'); -- insert into requests values('8', 'e', '#b10'); -- insert into requests values('9', 'c', '#b11'); -- --populating sample Messages -- insert into messages values('#b1', 'a', '1', 'I can play bass', '2019-10-08', '00:32:00'); -- insert into messages values('#b2', 'c', '1', 'I can DM a game', '2019-10-09', '00:32:00'); -- insert into messages values('#b3', 'd', '2', 'I like football', '2019-10-10', '00:32:00'); -- insert into messages values('#b4', 'e', '2', 'I love triva!', '2019-10-11', '00:32:00'); -- insert into messages values('#b5', 'a', '6', 'I NEED to start a band', '2019-10-12', '00:32:00'); -- insert into messages values('#b6', 'b', '7', 'I love animals so much', '2019-10-13', '00:32:00'); -- insert into messages values('#b7', 'a', '8', 'I play piano', '2019-10-14', '00:32:00'); -- insert into messages values('#b8', 'c', '8', 'I wanna play DnD', '2019-10-15', '00:32:00'); -- insert into messages values('#b9', 'd', '8', 'I like watching football', '2019-10-16', '00:32:00'); -- insert into messages values('#b10', 'e', '8', 'Trivia is great', '2019-10-17', '00:32:00'); -- insert into messages values('#b11', 'c', '9', 'Hi I really wanna join games!', '2019-10-18', '00:32:00');
true
7b3158bdf9fef819352630c02c076b7ecb1bf1d4
SQL
mrandybu/altrepo-server
/sql.d/wds/get_all_filtred_pkgs_with_deps.sql
UTF-8
302
2.96875
3
[]
no_license
SELECT DISTINCT pkgname, arrayFilter(x -> (x != pkgname AND notEmpty(x)), groupUniqArray(reqname)) AS arr FROM package_dependency WHERE reqname IN (SELECT '' UNION ALL SELECT pkgname FROM package_dependency) GROUP BY pkgname ORDER BY arr
true
91e830c1f714303b57ed77b1d2f8e9510b84be8e
SQL
alfa000/cnn
/inventory.sql
UTF-8
5,229
3.046875
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.6.5.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Aug 13, 2018 at 06:41 AM -- Server version: 10.1.21-MariaDB -- PHP Version: 7.1.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `inventory` -- -- -------------------------------------------------------- -- -- Table structure for table `barang` -- CREATE TABLE `barang` ( `kode_barang` varchar(10) NOT NULL, `sn` varchar(15) NOT NULL, `barcode` varchar(10) NOT NULL, `nama_barang` varchar(30) NOT NULL, `kondisi` varchar(10) NOT NULL, `status` varchar(10) NOT NULL, `ket` text NOT NULL, `tempat` varchar(25) NOT NULL, `foto` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT; -- -- Dumping data for table `barang` -- INSERT INTO `barang` (`kode_barang`, `sn`, `barcode`, `nama_barang`, `kondisi`, `status`, `ket`, `tempat`, `foto`) VALUES ('B0001', '', 'B000100001', 'Camera', 'Baik', 'Tersedia', 'a', 'Ditempat', ''), ('B0001', '', 'B000100002', 'Camera', 'Baik', 'Tersedia', 'a', 'Ditempat', ''), ('B0001', '', 'B000100003', 'Camera', 'Baik', 'Tersedia', 'a', 'Ditempat', ''), ('B0001', '', 'B000100004', 'Camera', 'Baik', 'Tersedia', 'a', 'Ditempat', ''), ('B0001', '', 'B000100005', 'Camera', 'Baik', 'Tersedia', 'a', 'Ditempat', ''), ('B0002', '', 'B000200001', 'Mic', 'Baik', 'Tersedia', 'aa', 'Ditempat', ''), ('B0002', '', 'B000200002', 'Mic', 'Baik', 'Tersedia', 'aa', 'Ditempat', ''), ('B0002', '', 'B000200003', 'Mic', 'Baik', 'Tersedia', 'aa', 'Ditempat', ''), ('B0002', '', 'B000200004', 'Mic', 'Baik', 'Tersedia', 'aa', 'Ditempat', ''), ('B0002', '', 'B000200005', 'Mic', 'Baik', 'Tersedia', 'aa', 'Ditempat', ''); -- -------------------------------------------------------- -- -- Table structure for table `barangtmp` -- CREATE TABLE `barangtmp` ( `kode_pinjam` varchar(20) NOT NULL, `kode_barang` varchar(10) NOT NULL, `sn` varchar(15) NOT NULL, `barcode` varchar(10) NOT NULL, `nama_barang` varchar(30) NOT NULL, `id_user` varchar(15) NOT NULL, `kondisi` varchar(10) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `pinjam` -- CREATE TABLE `pinjam` ( `kode_pinjam` varchar(15) NOT NULL, `kode_barang` varchar(10) NOT NULL, `barcode` varchar(10) NOT NULL, `id_user` varchar(15) NOT NULL, `w_pinjam` datetime NOT NULL, `w_kembali` datetime DEFAULT NULL, `kep` text NOT NULL, `status` varchar(15) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT; -- -- Dumping data for table `pinjam` -- INSERT INTO `pinjam` (`kode_pinjam`, `kode_barang`, `barcode`, `id_user`, `w_pinjam`, `w_kembali`, `kep`, `status`) VALUES ('080820180000001', 'B0001', '0001000001', 'K0001', '2018-08-08 15:50:19', '2018-08-09 22:45:56', 'aaa', 'Kembali'), ('080820180000001', 'B0001', '0001000002', 'K0001', '2018-08-08 15:50:19', '2018-08-09 22:45:56', 'aaa', 'Kembali'), ('130820180000002', 'B0001', 'B000100001', 'K0001', '2018-08-13 11:35:39', NULL, 'Liputan', 'Dipinjam'), ('130820180000002', 'B0001', 'B000100002', 'K0001', '2018-08-13 11:35:39', NULL, 'Liputan', 'Dipinjam'), ('130820180000002', 'B0001', 'B000100003', 'K0001', '2018-08-13 11:35:39', NULL, 'Liputan', 'Dipinjam'); -- -------------------------------------------------------- -- -- Table structure for table `user` -- CREATE TABLE `user` ( `id_user` varchar(15) NOT NULL, `nama` varchar(50) NOT NULL, `password` text NOT NULL, `foto` text NOT NULL, `no_hp` varchar(15) NOT NULL, `alamat` text NOT NULL, `agama` varchar(15) NOT NULL, `jenis_kelamin` varchar(15) NOT NULL, `level` varchar(10) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT; -- -- Dumping data for table `user` -- INSERT INTO `user` (`id_user`, `nama`, `password`, `foto`, `no_hp`, `alamat`, `agama`, `jenis_kelamin`, `level`) VALUES ('admin', 'admin', '21232f297a57a5a743894a0e4a801fc3', 'a.jpg', '1', 'a', 'Islam', 'Laki-laki', 'Admin'), ('cnn', 'CNN', 'ff7a4157153a8077212c8757fd39b8bd', 'cnn.png', '01293', 'Bandung', 'Islam', 'L', 'Admin'), ('K0001', 'Adnan', 'ee11cbb19052e40b07aac0ca060c23ee', 'K0001-my_last_gift_by_aenea_jones-das4298.jpg', '1029', 'a', 'katolik', 'Laki-laki', 'User'); -- -- Indexes for dumped tables -- -- -- Indexes for table `barang` -- ALTER TABLE `barang` ADD PRIMARY KEY (`kode_barang`,`sn`,`barcode`); -- -- Indexes for table `barangtmp` -- ALTER TABLE `barangtmp` ADD PRIMARY KEY (`kode_pinjam`,`kode_barang`,`sn`,`barcode`); -- -- Indexes for table `pinjam` -- ALTER TABLE `pinjam` ADD PRIMARY KEY (`kode_pinjam`,`kode_barang`,`barcode`,`id_user`), ADD KEY `id_kar` (`id_user`); -- -- Indexes for table `user` -- ALTER TABLE `user` ADD PRIMARY KEY (`id_user`); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
08123f431431dc43b883a19aa9ec7a56d6408c32
SQL
ahsantarique/PL-SQL
/1205021.sql
UTF-8
2,818
4.28125
4
[]
no_license
--offline 1 Set serveroutput on DECLARE MX NUMBER := -1; MXYEAR NUMBER; TYPE MONTHNAME IS VARRAY(12) OF VARCHAR2(3); TYPE MONTHNUM IS VARRAY(12) OF NUMBER; MN MONTHNAME; MC MONTHNUM; CURSOR C1 IS SELECT JOINYEAR, COUNT(*) CNT FROM (SELECT EXTRACT(YEAR FROM HIRE_DATE) AS JOINYEAR FROM EMPLOYEES) GROUP BY JOINYEAR; CURSOR C2 IS SELECT YY, MM, COUNT(*) AS CNT FROM (SELECT EXTRACT(YEAR FROM HIRE_DATE) AS YY, EXTRACT(MONTH FROM HIRE_DATE) AS MM FROM EMPLOYEES) GROUP BY (YY,MM) ORDER BY YY,MM ASC; EMPYEAR C1%ROWTYPE; MONTHCNT C2%ROWTYPE; BEGIN IF NOT(C1%ISOPEN) THEN OPEN C1; END IF; LOOP EXIT WHEN (C1%NOTFOUND); FETCH C1 INTO EMPYEAR; IF(EMPYEAR.CNT > MX) THEN MX := EMPYEAR.CNT; MXYEAR := EMPYEAR.JOINYEAR; END IF; END LOOP; CLOSE C1; Dbms_Output.Put('MAXIMUM EMPLOYEES JOINED: ' || MX); Dbms_Output.Put_Line(' IN THE YEAR: ' || MXYEAR); MN := MONTHNAME('JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'); MC := MONTHNUM(0,0,0,0,0,0,0,0,0,0,0,0); IF NOT (C2%ISOPEN) THEN OPEN C2; END IF; LOOP EXIT WHEN(C2%NOTFOUND); FETCH C2 INTO MONTHCNT; IF(MONTHCNT.YY = MXYEAR) THEN --Dbms_Output.Put_Line(MONTHCNT.MM || ' : ' || MONTHCNT.CNT); MC(MONTHCNT.MM) := MONTHCNT.CNT; END IF; END LOOP; CLOSE C2; FOR II IN 1..12 LOOP Dbms_Output.Put_Line(MN(II) || ' : ' || MC(II)); END LOOP; END; / --offline 2 set serveroutput on CREATE OR REPLACE PROCEDURE DISP_DEPT(C_ID IN VARCHAR2 ) AS CURSOR C1 IS SELECT D.DEPARTMENT_ID, D.DEPARTMENT_NAME FROM DEPARTMENTS D JOIN LOCATIONS L ON D.LOCATION_ID = L.LOCATION_ID WHERE L.COUNTRY_ID = C_ID; VDEPT C1%ROWTYPE; BEGIN /* SELECT * FROM LOCATIONS; SELECT * FROM DEPARTMENTS;*/ IF NOT(C1%ISOPEN) THEN OPEN C1; END IF; IF(C1%NOTFOUND) THEN DBMS_OUTPUT.PUT_LINE('NO DEPARTMENTS IN THAT COUNTRY!'); ELSE DBMS_OUTPUT.PUT_LINE('THE FOLLOWING DEPARTMETNS ARE IN COUNTRY_ID: ' || C_ID); END IF; LOOP EXIT WHEN C1%NOTFOUND; FETCH C1 INTO VDEPT; DBMS_OUTPUT.PUT_LINE('ID : ' || VDEPT.DEPARTMENT_ID || ' ' || 'DEPARTMENT NAME: ' || VDEPT.DEPARTMENT_NAME); END LOOP; CLOSE C1; END; / --offline 3 set serveroutput on CREATE OR REPLACE TRIGGER LIMIT_JOBS BEFORE INSERT OR UPDATE ON EMPLOYEES FOR EACH ROW DECLARE N NUMBER := 30; CURSOR C1 IS SELECT JOB_ID, COUNT(*) AS CNT FROM EMPLOYEES GROUP BY JOB_ID; VJOBCNT C1%ROWTYPE; BEGIN IF NOT (C1%ISOPEN) THEN OPEN C1; END IF; LOOP EXIT WHEN C1%NOTFOUND; FETCH C1 INTO VJOBCNT; IF(VJOBCNT.CNT > N) THEN RAISE_APPLICATION_ERROR(-20001, 'CANNOT BE MORE THAN ' || N || ' EMPLOYEES UNDER A JOB'); END IF; END LOOP; CLOSE C1; END LIMIT_JOBS; / /* insert into employees(employee_id,hire_date,job_id,last_name,email) values (365, '21-AUG-1995', 'SA_REP', 'BOSS', 'abc@gmail.com'); exec disp_dept('US'); */
true
3476320d52e5a6581dab4f0a0a21464bc87b9b62
SQL
pearlisme/spring-boot-jsf-javaconfig
/src/main/resources/schema.sql
UTF-8
542
3.234375
3
[]
no_license
/* create table product ( id INTEGER NOT NULL AUTO_INCREMENT, -- id identity not null, name varchar (255) not null, price double not null );*/ drop table IF EXISTS country; drop table IF EXISTS product; CREATE TABLE country (     id INTEGER NOT NULL AUTO_INCREMENT,     name VARCHAR(128) NOT NULL,     PRIMARY KEY (id) ); CREATE TABLE product ( --     id INTEGER NOT NULL AUTO_INCREMENT,     id identity NOT NULL,     name VARCHAR(128) NOT NULL, price double not null -- ,    PRIMARY KEY (id) );
true
3f35edcda1490801be2829c03b24ec0eb33b3fd3
SQL
sun142725/myapp
/server-node/database.sql
UTF-8
11,436
2.65625
3
[]
no_license
/* Navicat MySQL Data Transfer Source Server : locaohost Source Server Version : 50726 Source Host : localhost:3306 Source Database : test Target Server Type : MYSQL Target Server Version : 50726 File Encoding : 65001 Date: 2019-08-19 17:34:34 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for chat_room -- ---------------------------- DROP TABLE IF EXISTS `chat_room`; CREATE TABLE `chat_room` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `room_id` varchar(255) NOT NULL, `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `type` int(10) NOT NULL COMMENT '0 : 二人聊天\r\n1 : 群聊', `mobile` varchar(255) NOT NULL, `member_pos` int(10) unsigned zerofill NOT NULL COMMENT '0 : 成员\r\n1 : 群主', `status` int(10) unsigned zerofill NOT NULL DEFAULT '0000000000' COMMENT '0 : 正常\r\n1 : 冻结\r\n2 : 离开\r\n3 : 待定\r\n4 : 待定\r\n5 : 解散 ', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=56 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of chat_room -- ---------------------------- INSERT INTO `chat_room` VALUES ('42', '183347713581565846914337', '2019-08-15 13:28:34', '2019-08-15 13:28:34', '0', '18334771358', '0000000000', '0000000000'); INSERT INTO `chat_room` VALUES ('43', '183347713581565846914337', '2019-08-15 13:28:34', '2019-08-15 13:28:34', '0', '18334771358', '0000000000', '0000000000'); INSERT INTO `chat_room` VALUES ('44', '183347713581565846914337', '2019-08-15 13:30:14', '2019-08-15 13:30:14', '0', '18334771358', '0000000000', '0000000000'); INSERT INTO `chat_room` VALUES ('45', '183347713581565846914337', '2019-08-15 13:30:14', '2019-08-15 13:30:14', '0', '18334771353', '0000000000', '0000000000'); INSERT INTO `chat_room` VALUES ('46', '183347713581565847056350', '2019-08-15 13:30:56', '2019-08-15 13:30:56', '0', '18334771358', '0000000000', '0000000000'); INSERT INTO `chat_room` VALUES ('47', '183347713581565847056350', '2019-08-15 13:30:56', '2019-08-15 13:30:56', '0', '18334771358', '0000000000', '0000000000'); INSERT INTO `chat_room` VALUES ('48', '183347713581565847228823', '2019-08-15 13:33:48', '2019-08-15 13:33:48', '0', '18334771358', '0000000000', '0000000000'); INSERT INTO `chat_room` VALUES ('49', '183347713581565847228823', '2019-08-15 13:33:48', '2019-08-15 13:33:48', '0', '18334771352', '0000000000', '0000000000'); INSERT INTO `chat_room` VALUES ('50', '183347713581565850590312', '2019-08-15 14:29:50', '2019-08-15 14:29:50', '0', '18334771358', '0000000000', '0000000000'); INSERT INTO `chat_room` VALUES ('51', '183347713581565850590312', '2019-08-15 14:29:50', '2019-08-15 14:29:50', '0', '', '0000000000', '0000000000'); INSERT INTO `chat_room` VALUES ('52', '18334771351565851506442', '2019-08-15 14:45:06', '2019-08-15 14:45:06', '0', '1833477135', '0000000000', '0000000000'); INSERT INTO `chat_room` VALUES ('53', '18334771351565851506442', '2019-08-15 14:45:06', '2019-08-15 14:45:06', '0', '', '0000000000', '0000000000'); INSERT INTO `chat_room` VALUES ('54', '183347713581565764374222', '2019-08-15 14:45:45', '2019-08-19 10:20:23', '0', '18334771357', '0000000000', '0000000000'); INSERT INTO `chat_room` VALUES ('55', '183347713581565764374222', '2019-08-15 14:45:45', '2019-08-19 10:09:18', '0', '18334771358', '0000000000', '0000000000'); -- ---------------------------- -- Table structure for chat_room_history -- ---------------------------- DROP TABLE IF EXISTS `chat_room_history`; CREATE TABLE `chat_room_history` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `room_id` varchar(255) NOT NULL, `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `type` varchar(255) NOT NULL COMMENT 'text : 二人聊天 image : 图片 file : 文件 custom : 自定义 system: 系统消息', `content` varchar(255) DEFAULT NULL, `describe` varchar(255) DEFAULT NULL, `send_mobile` varchar(255) NOT NULL, `status` int(10) unsigned zerofill NOT NULL DEFAULT '0000000000' COMMENT '0 : 正常\r\n1 : 删除 ', `already_read` int(10) unsigned zerofill NOT NULL DEFAULT '0000000000' COMMENT '0 : 未读1 : 已读 ', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of chat_room_history -- ---------------------------- INSERT INTO `chat_room_history` VALUES ('9', '183347713581565764374222', '2019-08-15 10:00:56', '2019-08-15 11:22:24', 'text', '23123321', '123', '18334771358', '0000000001', '0000000000'); INSERT INTO `chat_room_history` VALUES ('10', '183347713581565764374222', '2019-08-15 10:02:24', '2019-08-15 10:02:24', 'text', '2133333333333333', '111', '18334771358', '0000000000', '0000000000'); INSERT INTO `chat_room_history` VALUES ('11', '183347713581565764374222', '2019-08-15 10:02:42', '2019-08-19 10:24:58', 'text', '2133333333333333', '111', '18334771358', '0000000000', '0000000000'); INSERT INTO `chat_room_history` VALUES ('12', '183347713581565764374222', '2019-08-19 10:25:37', '2019-08-19 10:25:39', 'text', '2133', '222', '18334771357', '0000000000', '0000000000'); -- ---------------------------- -- Table structure for friend -- ---------------------------- DROP TABLE IF EXISTS `friend`; CREATE TABLE `friend` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `room_id` varchar(255) NOT NULL, `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `mobile` varchar(255) NOT NULL, `friend_mobile` varchar(255) NOT NULL, `status` int(10) unsigned zerofill NOT NULL COMMENT '0 : 正常 1 : 待接受 2 : 删除', `is_invitation` int(10) unsigned zerofill NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=33 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of friend -- ---------------------------- INSERT INTO `friend` VALUES ('9', '183347713581565764374222', '2019-08-14 14:32:54', '2019-08-14 14:57:44', '18334771358', '18334771357', '0000000000', '0000000000'); INSERT INTO `friend` VALUES ('10', '183347713581565764374222', '2019-08-14 14:32:54', '2019-08-14 14:57:44', '18334771357', '18334771358', '0000000000', '0000000000'); INSERT INTO `friend` VALUES ('11', '183347713581565765962981', '2019-08-14 14:59:22', '2019-08-16 11:18:49', '18334771358', '18334771356', '0000000000', '0000000001'); INSERT INTO `friend` VALUES ('12', '183347713581565765962981', '2019-08-14 14:59:22', '2019-08-14 14:59:22', '18334771356', '18334771358', '0000000001', '0000000000'); INSERT INTO `friend` VALUES ('13', '183347713581565765974196', '2019-08-14 14:59:34', '2019-08-16 11:18:53', '18334771358', '18334771356', '0000000000', '0000000001'); INSERT INTO `friend` VALUES ('14', '183347713581565765974196', '2019-08-14 14:59:34', '2019-08-14 14:59:34', '18334771356', '18334771358', '0000000001', '0000000000'); INSERT INTO `friend` VALUES ('15', '183347713581565768284039', '2019-08-14 15:38:04', '2019-08-16 11:18:54', '18334771358', '18334771356', '0000000000', '0000000001'); INSERT INTO `friend` VALUES ('16', '183347713581565768284039', '2019-08-14 15:38:04', '2019-08-14 15:38:04', '18334771356', '18334771358', '0000000001', '0000000000'); INSERT INTO `friend` VALUES ('17', '183347713581565768383058', '2019-08-14 15:39:43', '2019-08-16 11:18:55', '18334771358', '18334771355', '0000000000', '0000000001'); INSERT INTO `friend` VALUES ('18', '183347713581565768383058', '2019-08-14 15:39:43', '2019-08-14 15:39:43', '18334771355', '18334771358', '0000000001', '0000000000'); INSERT INTO `friend` VALUES ('19', '183347713581565846859759', '2019-08-15 13:27:39', '2019-08-16 11:18:55', '18334771358', '18334771354', '0000000000', '0000000001'); INSERT INTO `friend` VALUES ('20', '183347713581565846859759', '2019-08-15 13:27:39', '2019-08-15 13:27:39', '18334771354', '18334771358', '0000000001', '0000000000'); INSERT INTO `friend` VALUES ('25', '183347713581565847228823', '2019-08-15 13:33:48', '2019-08-16 11:18:56', '18334771358', '18334771352', '0000000000', '0000000001'); INSERT INTO `friend` VALUES ('26', '183347713581565847228823', '2019-08-15 13:33:48', '2019-08-15 13:33:48', '18334771352', '18334771358', '0000000001', '0000000000'); INSERT INTO `friend` VALUES ('27', '183347713581565850590312', '2019-08-15 14:29:50', '2019-08-16 11:19:22', '18334771358', '18334771352', '0000000000', '0000000001'); INSERT INTO `friend` VALUES ('28', '183347713581565850590312', '2019-08-15 14:29:50', '2019-08-15 14:29:50', '', '18334771358', '0000000001', '0000000000'); INSERT INTO `friend` VALUES ('29', '18334771351565851506442', '2019-08-15 14:45:06', '2019-08-15 14:45:06', '1833477135', '', '0000000001', '0000000001'); INSERT INTO `friend` VALUES ('30', '18334771351565851506442', '2019-08-15 14:45:06', '2019-08-15 14:45:06', '', '1833477135', '0000000001', '0000000000'); INSERT INTO `friend` VALUES ('31', '1565851545135', '2019-08-15 14:45:45', '2019-08-15 14:45:45', '', '', '0000000001', '0000000001'); INSERT INTO `friend` VALUES ('32', '1565851545135', '2019-08-15 14:45:45', '2019-08-15 14:45:45', '', '', '0000000001', '0000000000'); -- ---------------------------- -- Table structure for user -- ---------------------------- DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `mobile` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `name` varchar(16) DEFAULT NULL, `idCardNo` varchar(20) DEFAULT NULL COMMENT '身份证号', `nickName` varchar(16) DEFAULT NULL COMMENT '昵称', `headUrl` varchar(255) DEFAULT NULL, `age` smallint(10) DEFAULT NULL, `status` smallint(10) NOT NULL DEFAULT '0' COMMENT '是否实名', `create_time` datetime DEFAULT CURRENT_TIMESTAMP, `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `mobile` (`mobile`) ) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of user -- ---------------------------- INSERT INTO `user` VALUES ('1', '18334771358', '1234567', '红红', '142725199501181722', '红红', null, '0', '1', '2019-08-13 15:11:10', '2019-08-13 17:11:04'); INSERT INTO `user` VALUES ('2', '18334771357', '123456', '111', null, '777', null, null, '0', '2019-08-13 15:11:23', '2019-08-14 16:06:39'); INSERT INTO `user` VALUES ('3', '18334771356', '1234567', '111', null, '222', null, null, '0', '2019-08-13 15:11:28', '2019-08-14 16:06:31'); INSERT INTO `user` VALUES ('4', '18334771355', '1234567', '红红1', '14272519950118172', '红红1', null, null, '0', '2019-08-14 13:46:20', '2019-08-14 13:46:20'); INSERT INTO `user` VALUES ('5', '18334771354', '1234567', '红红4', '14272519950118172', '红红1', null, null, '0', '2019-08-14 13:46:35', '2019-08-14 16:06:24'); INSERT INTO `user` VALUES ('6', '18334771353', '1234567', '红红3', '14272519950118172', '红红3', null, null, '0', '2019-08-14 13:46:49', '2019-08-14 13:46:49'); INSERT INTO `user` VALUES ('7', '18334771352', '1234567', '红红2', '14272519950118172', '红红2', null, null, '0', '2019-08-14 13:47:02', '2019-08-14 13:47:02'); INSERT INTO `user` VALUES ('8', '18334771351', '123', 'bbbb', null, null, null, null, '0', '2019-08-19 15:37:10', '2019-08-19 16:39:34');
true
db314cbc9692a280533a3f9984b45a337846cd7a
SQL
samlin0508/ust-demo-api
/ust-demo-api/SQL/create-schema.sql
UTF-8
463
2.578125
3
[]
no_license
CREATE DATABASE `ust-demo` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */; CREATE TABLE `reminder` ( `id` int(11) NOT NULL AUTO_INCREMENT, `summary` varchar(256) COLLATE utf8_unicode_ci DEFAULT NULL, `description` longtext COLLATE utf8_unicode_ci, `createDate` datetime DEFAULT CURRENT_TIMESTAMP, `updateDate` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
true
b4cb925b000688a09f176017ae1f34c85cea4c19
SQL
ikechavie/Car-Repo
/Assignment 4/Q4.sql
UTF-8
155
3.28125
3
[]
no_license
WITH VTypeCount AS (SELECT VehicleID, VehicleType FROM Vehicle) SELECT VehicleType, COUNT(*) AS VehicleTotalByID FROM VTypeCount GROUP BY VehicleType;
true
e1cc271027d33a3ecd9dc79814cf5f671f94021f
SQL
CUBRID/cubrid-testcases
/sql/_06_manipulation/_01_select/_006_group_by/cases/1022.sql
UTF-8
1,395
3.796875
4
[ "BSD-3-Clause" ]
permissive
--Test group by in range partition class create class test ( testno char(10) not null, testname varchar(20) not null, deptname varchar(20), testdate date, primary key(testdate) ) partition by range (extract (year from testdate)) ( partition h2000 values less than (2000), partition h2003 values less than (2003), partition hmax values less than maxvalue); INSERT INTO TEST VALUES ('00001', 'Junghee', 'planning', TO_DATE('19991115', 'YYYYMMDD')); INSERT INTO TEST VALUES ('00002', 'Sungsoo', 'public_information', TO_DATE('20001115', 'YYYYMMDD')); INSERT INTO TEST VALUES ('00003', 'Junho', 'account', TO_DATE('20021115', 'YYYYMMDD')); INSERT INTO TEST VALUES ('00004', 'Daejung', 'R&D', TO_DATE('20011115', 'YYYYMMDD')); INSERT INTO TEST VALUES ('00005', 'Dongho', 'sales', TO_DATE('20031115', 'YYYYMMDD')); INSERT INTO TEST VALUES ('00006', 'Oakhyun', 'sales', TO_DATE('20030601', 'YYYYMMDD')); INSERT INTO TEST VALUES ('00007', 'Dongyoung', 'account', TO_DATE('20040301', 'YYYYMMDD')); INSERT INTO TEST VALUES ('00008', 'Byungmo', 'public_information', TO_DATE('20050601', 'YYYYMMDD')); INSERT INTO TEST VALUES ('00009', 'Aeran', 'planning', TO_DATE('20060601', 'YYYYMMDD')); INSERT INTO TEST VALUES ('00010', 'Yoonjung', 'R&D', TO_DATE('20070601', 'YYYYMMDD')); select deptname, max(testdate) from test group by deptname; drop class test;
true
52a13abcccb6765694091095e7b27f77ce560ff7
SQL
YunoTeru/Vote
/vote.sql
UTF-8
2,143
3
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Host: localhost:8889 -- Generation Time: May 24, 2019 at 09:50 AM -- Server version: 5.7.25 -- PHP Version: 7.3.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; -- -- Database: `vote` -- -- -------------------------------------------------------- -- -- Table structure for table `display` -- CREATE TABLE `display` ( `display_id` int(11) NOT NULL, `display_name` varchar(50) CHARACTER SET utf8 NOT NULL, `display_user_id` int(11) NOT NULL, `display_img` varchar(100) CHARACTER SET utf8 NOT NULL, `display_vote` int(11) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `display` -- INSERT INTO `display` (`display_id`, `display_name`, `display_user_id`, `display_img`, `display_vote`) VALUES (2, 'Emillia', 5, 'images/87cd6767a5da479b844d7bcda84f8cfb.jpg', 12), (4, 'Japanese', 7, 'images/9404daa046539c07873bb8b92fd71fe2.jpg', 25), (5, 'MINA_gif', 8, 'images/original.gif', 3), (6, 'Korean', 9, 'images/d7249ad7055d2bf2ec1d640d753e3a15.jpg', 4), (7, 'MInami', 10, 'images/IMG_6211.JPG', 1), (8, 'Kasumi', 11, 'images/IMG_3820.JPG', 22), (12, 'MINA MYOUI', 2, 'images/IMG_3081.JPG', 28), (15, 'BLACK', 1, 'images/neho.jpeg', 196), (17, 'Ugaki', 4, 'images/7e94a039b56ffb369682ce9a7f585c3f.jpg', 5), (19, 'Woman', 3, 'images/be2419fc43a884f2b8e23e66db61d43f.jpg', 24), (20, 'Cheyon', 6, 'images/4c37b7f8eb2cedc231be22ea19d98779.jpg', 7), (21, 'MOMO', 1, 'images/2334b7a6ebac94f884e688deeb70c30b.jpg', 5), (22, 'JONYON', 4, 'images/1b01b92213e255768bd31a8d3d11d22e.jpg', 20), (23, 'SANA', 4, 'images/e4a104c964ba0679bbc36c398e026237.jpg', 15), (24, 'Tyuyu', 1, 'images/0c0ee49d097fd009c9232804147f4d74.jpg', 0), (25, 'Jisoo', 12, 'images/e460481ad4a4091cedb91ffec228ccce.jpg', 23); -- -- Indexes for dumped tables -- -- -- Indexes for table `display` -- ALTER TABLE `display` ADD PRIMARY KEY (`display_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `display` -- ALTER TABLE `display` MODIFY `display_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=27;
true
463305e088095ccb611409f8ff328318ddb175f3
SQL
DS-Felipe-Jacinto/BD-2021
/Revisão - BD (09-09-2021)/Arquivos (.sql)/bdRevisao.sql
UTF-8
1,356
4.1875
4
[]
no_license
CREATE DATABASE bdRevisao /* Criando uma base de dados */ USE bdRevisao /* Indicando o banco de dados a ser usado */ /* Criando a tabela para armazenamento dos dados dos Cliente */ CREATE TABLE tbl_Cliente( Codigo INT PRIMARY KEY IDENTITY (1,1) ,Nome VARCHAR (50) ,dataNascimento DATE ); CREATE TABLE tbl_Telefones ( Codigo INT FOREIGN KEY REFERENCES tbl_Cliente ,Fone VARCHAR (50) ,Tipo VARCHAR (50) ); /* ============================================================================================================================*/ /* Inserindo os dados na tabela 'tbl_Cliente' */ INSERT INTO tbl_Cliente (Nome, dataNascimento) VALUES ('Marcio','1/05/2007') ,('Marlos','5/08/1980') ,('Luciene','10/05/1970') ,('Wilkie','12/03/1984') /* Inserindo os dados na tabela 'tbl_Telefones' */ INSERT INTO tbl_Telefones (Codigo, Fone, Tipo) VALUES (1,'9999-8888','Residencial') ,(1,'7777-6666','Celular') ,(2,'5555-4444','Celular') ,(3,'2222-1111','Residencial') SELECT * FROM tbl_Cliente SELECT * FROM tbl_Telefones /* ============================================================================================================================*/ /* Buscando o Nome na tbl_Cliente e Telefone (Fone) na tabela tbl_Telefones */ SELECT d.Nome, p.Fone FROM tbl_Cliente d inner join tbl_Telefones p ON d.Codigo = p.Codigo
true
7bd3fd8638260e8f6fe933c63918d87f50887ac9
SQL
olpbruno/desafiofinal-academy
/models/staging/stg_personcreditcard.sql
UTF-8
392
3.421875
3
[]
no_license
with source_data as ( select creditcardid as id_cartao, businessentityid as id_pessoa from {{ source('adventure_works','personcreditcard') }} ), source_with_sk as( select * , {{ dbt_utils.surrogate_key(['id_cartao']) }} as sk_cartao , {{ dbt_utils.surrogate_key(['id_pessoa']) }} as sk_pessoa from source_data ) select * from source_with_sk
true
0eb137cdee020b63d89b7902a06d3eee48123858
SQL
zhangcy11/zcytest
/select.sql
UTF-8
2,560
4.875
5
[]
no_license
# 1.查询同时存在1课程和2课程的情况 SELECT C1.studentid, C3.name, C3.age, C3.sex, C1.score AS score1, C2.score AS score2 FROM (SELECT * FROM student_course WHERE courseid = 1) AS C1 inner JOIN (SELECT * FROM student_course WHERE courseid = 2) AS C2 ON C1.studentid = C2.studentid inner JOIN student AS C3 ON C1.studentid = C3.id; # 2.查询同时存在1课程和2课程的情况 SELECT C1.studentid, C3.name, C3.age, C3.sex, C1.score AS score1, C2.score AS score2 FROM (SELECT * FROM student_course WHERE courseid = 1) AS C1 inner JOIN (SELECT * FROM student_course WHERE courseid = 2) AS C2 ON C1.studentid = C2.studentid inner JOIN student AS C3 ON C1.studentid = C3.id; # 3.查询平均成绩大于等于60分的同学的学生编号和学生姓名和平均成绩 SELECT S1.id, S1.name, S2.avg AS 平均成绩 FROM Student AS S1 INNER JOIN ( SELECT studentid, AVG(score) AS avg FROM student_course GROUP BY studentid HAVING AVG(score) >= 60) AS S2 ON S1.id = S2.studentid; # 4.查询在student_course表中不存在成绩的学生信息的SQL语句 select * from student where id not in (select studentId from student_course); # 5.查询所有有成绩的SQL select * from student where id in (select distinct studentId from student_course); # 6.查询学过编号为1并且也学过编号为2的课程的同学的信息 SELECT C1.studentid, C3.name, C3.age, C3.sex FROM (SELECT * FROM student_course WHERE courseid = 1) AS C1 inner JOIN (SELECT * FROM student_course WHERE courseid = 2) AS C2 ON C1.studentid = C2.studentid inner JOIN student AS C3 ON C1.studentid = C3.id; # 7.检索1课程分数小于60,按分数降序排列的学生信息 select S.id, S.name, S.age, S.sex, score FROM (SELECT * FROM student_course WHERE courseid = 1 AND score < 60) AS A1 INNER JOIN Student AS S ON A1.studentid = S.id ORDER BY score DESC; # 8.查询每门课程的平均成绩,结果按平均成绩降序排列,平均成绩相同时,按课程编号升序排列 SELECT C.name, C.id, AVG(SC.score) FROM student_course as SC INNER JOIN course AS C ON SC.courseid = C.id GROUP BY C.id,C.name ORDER BY AVG(SC.Score) DESC, C.id; # 9.查询课程名称为"数学",且分数低于60的学生姓名和分数 SELECT S.name, C.name, SC.score FROM student AS S INNER JOIN student_course as SC ON S.id = SC.studentid INNER JOIN course AS C ON SC.courseid = C.id WHERE C.name = '数学' AND SC.score < 60;
true
1abf9870424761172f66d930312394718fb3bca7
SQL
santhoshar90/HexAssignment-BackEnd
/Hex-Assignment/DbScripts/TableScript.sql
UTF-8
697
3.671875
4
[]
no_license
--Creating DB CREATE DATABASE [Hex-DB] ----Creating Table USER_MASTER CREATE TABLE USER_MASTER ( ID INT Primary KEY IDENTITY(1,1), Email nvarchar(127) not null, [Password] nvarchar(127) not null ) ----Creating Table SOFTSKILL_AREA CREATE TABLE SOFTSKILL_AREA ( ID INT Primary KEY IDENTITY(1,1), SkillSet nvarchar(63) not null ) ----Creating Table USER_SKILL_RATING CREATE TABLE USER_SKILL_RATING ( USERID INT, SKILLSETID INT, SKILLSETVALUE INT ) ALTER TABLE USER_SKILL_RATING ADD CONSTRAINT FK_USER_MASTER_UserID FOREIGN KEY (UserID) REFERENCES USER_MASTER(ID); ALTER TABLE USER_SKILL_RATING ADD CONSTRAINT FK_SOFTSKILL_AREA_UserID FOREIGN KEY (SKILLSETID) REFERENCES SOFTSKILL_AREA(ID);
true
f3957de86cce911120c2ff4e77b2e9a9250bde25
SQL
papesdiop/BusFloatingData
/commons/src/main/resources/create_tables.cql
UTF-8
1,664
3.90625
4
[ "Apache-2.0" ]
permissive
CREATE KEYSPACE IF NOT EXISTS streaming WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}; CREATE TABLE IF NOT EXISTS streaming.routeInfos ( id text, display_name text, PRIMARY KEY (id) ); CREATE TABLE IF NOT EXISTS streaming.vehicles ( id text, time timestamp, longitude double, latitude double, heading int, route_id text, run_id text, seconds_since_report int, PRIMARY KEY (id, time) ); CREATE TABLE IF NOT EXISTS streaming.routes ( id text, order_id int, route_id text, longitude double, latitude double, display_name text, PRIMARY KEY (route_id, order_id, id) ) WITH CLUSTERING ORDER BY (order_id ASC); CREATE TABLE IF NOT EXISTS streaming.vehicles_by_tileid ( tile_id text, time_id bigint, id text, time timestamp, longitude double, latitude double, heading int, route_id text, run_id text, seconds_since_report int, PRIMARY KEY ((tile_id, time_id), time, id) ) WITH CLUSTERING ORDER BY (time DESC); CREATE TABLE IF NOT EXISTS streaming.vehiclecluster ( id int, time_stamp bigint, longitude double, latitude double, amount int, PRIMARY KEY (id, time_stamp) ); CREATE TABLE IF NOT EXISTS streaming.vehiclecluster_by_tileid ( tile_id text, id int, time_stamp bigint, longitude double, latitude double, amount int, PRIMARY KEY (tile_id, id, time_stamp) ); CREATE TABLE IF NOT EXISTS streaming.vehicleclusterdetails ( id bigint, pos_id int, time_stamp bigint, longitude double, latitude double, PRIMARY KEY (id, pos_id, time_stamp) );
true
c871bc82c774473683166473824abb45558441f1
SQL
jonathanferreiras/backend_triider
/tridder.sql
UTF-8
878
3.6875
4
[]
no_license
CREATE SEQUENCE schedules_seq; CREATE TABLE schedules ( idschedules INTEGER CHECK (idschedules > 0) NOT NULL DEFAULT NEXTVAL ('schedules_seq'), users_iduser INTEGER CHECK (users_iduser > 0) NOT NULL, name VARCHAR(100) NULL, date TIMESTAMP(0) NULL, place VARCHAR(200) NULL, blocking BOOL NULL, requester INTEGER CHECK (requester > 0) NOT NULL, PRIMARY KEY(idschedules) ); CREATE INDEX schedules_FKIndex1 ON schedules(users_iduser); CREATE SEQUENCE users_seq; CREATE TYPE type_user AS ENUM('user','animator'); CREATE TYPE type_animator AS ENUM('clown','magic','juggler'); CREATE TABLE users ( iduser INTEGER CHECK (iduser > 0) NOT NULL DEFAULT NEXTVAL ('users_seq'), name VARCHAR(200) NULL, email VARCHAR(50) NULL, pass VARCHAR(50) NULL, type_user type_user, price DOUBLE PRECISION NULL, type_animator type_animator, PRIMARY KEY(iduser) );
true
d38cfdf9692e99824faafee32a4b6b1acf8dec5e
SQL
DominiqueSparrow/Spring1
/resources/sql/create.sql
UTF-8
355
3.484375
3
[]
no_license
drop table customer_request; create table customer_request ( request_id INTEGER , timestamp timestamp, customer_id number(10), request_address varchar(30), primary key(request_id), constraint customer_request_fk foreign key (customer_id) references CUSTOMERS(CUSTOMER_ID) ); CREATE SEQUENCE CUSTOMER_REQUEST_ID_SEQ;
true
2749e3c357b960a458bc072c30a483743bd80304
SQL
rameshlakshman/hadoop-training-projects-1
/hive/nyse_trading/table_creation.sql
UTF-8
2,225
3.640625
4
[]
no_license
-- create a database for this project create database handson_nasdaq; --Create a managed table for NASDAQ daily prices data set. create table tbl_nasdaq_daily_prices ( exchange_name string,stock_symbol string,date string,stock_price_open float, stock_price_high float,stock_price_low float,stock_price_close float, stock_volume int, stock_price_adj_close float ) row format delimited fields terminated by ','; --Create a managed table for NASDAQ daily prices data set with parquet data format create table tbl_nasdaq_daily_prices_parquet ( exchange_name string,stock_symbol string,date string,stock_price_open float, stock_price_high float,stock_price_low float,stock_price_close float, stock_volume int, stock_price_adj_close float ) stored as parquet; --Create an external table for NASDAQ daily prices data set. create external table nasdaq_daily_prices ( exchange_name string,stock_symbol string,date string,stock_price_open float, stock_price_high float,stock_price_low float,stock_price_close float, stock_volume int, stock_price_adj_close float ) row format delimited fields terminated by ',' location '/user/cloudera/rawdata/hadoop_class/nasdaq_prices'; -- Create an external table for NASDAQ dividends data set. create external table nasdaq_dividends ( exchange_name string,stock_symbol string, date string, dividends float ) row format delimited fields terminated by ',' location '/user/cloudera/rawdata/hadoop_class/nasdaq_dividend'; -- create a managed avro table create table nasdaq_dividends_avro ( exchange_name string,stock_symbol string, date string, dividends float ) stored as avro; --alter table to add the schema location alter table nasdaq_dividends_avro set location '/user/cloudera/rawdata/hadoop_class/nasdaq_dividend_avro'; -- alter a table to add a table property alter table nasdaq_dividends_avro set tblproperties('author'='michael enudi') -- alter table to rename the table alter table nasdaq_dividends_avro rename to avro_dividend -- to recreate the sql statement used to create a table -- also use the output to view the real details for building a hive table show create table nasdaq_daily_prices; -- view details of our new avro table show create table nasdaq_dividends_avro;
true
8bdc6f357a5207c4d1f73382f508b86e77b126c8
SQL
a-wq/webprojs
/dbscript/furnit.sql
UTF-8
12,612
3.296875
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.8.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Oct 22, 2018 at 04:16 PM -- Server version: 10.1.34-MariaDB -- PHP Version: 7.2.7 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `onlinestore` -- -- -------------------------------------------------------- -- -- Table structure for table `admin` -- CREATE TABLE `admin` ( `id` int(11) NOT NULL, `firstname` varchar(255) NOT NULL, `lastname` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `password` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `admin` -- INSERT INTO `admin` (`id`, `firstname`, `lastname`, `email`, `password`) VALUES (1, 'Saamako', 'Admin', 'admin@samako.com', '$2y$10$tc5kQ8voWvAiZHst1P97ju/pBPCS6RnGJ1jZsY61Ss2Fef6GYF3eK'); -- -------------------------------------------------------- -- -- Table structure for table `categories` -- CREATE TABLE `categories` ( `cat_id` int(100) NOT NULL, `cat_title` text NOT NULL, `status` enum('In_Use','Not_In_Use') NOT NULL, `Date_Added` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `categories` -- INSERT INTO `categories` (`cat_id`, `cat_title`, `status`, `Date_Added`) VALUES (2, 'Chair', 'In_Use', '2018-09-30'), (3, 'Sofa', 'In_Use', '2018-09-30'), (4, 'Table', 'In_Use', '2018-09-30'), (5, 'Office Desk', 'In_Use', '2018-09-30'), (6, 'Dinning', 'In_Use', '2018-09-30'), (7, 'Bedroom', 'In_Use', '2018-09-30'), (8, 'Occasional', 'In_Use', '2018-09-30'), (9, 'Home Decor', 'In_Use', '2018-09-30'); -- -------------------------------------------------------- -- -- Table structure for table `orderitems` -- CREATE TABLE `orderitems` ( `id` int(11) NOT NULL, `pid` int(11) NOT NULL, `pquantity` varchar(255) NOT NULL, `orderid` int(11) NOT NULL, `productprice` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `orderitems` -- INSERT INTO `orderitems` (`id`, `pid`, `pquantity`, `orderid`, `productprice`) VALUES (1, 19, '5', 1, '16'), (2, 19, '5', 2, '16'), (3, 1, '2', 2, '20990'), (4, 1, '1', 3, '20990'), (5, 20, '10', 3, '99'), (6, 18, '1', 4, '12890'), (7, 21, '1', 4, '75'), (8, 2, '1', 5, '7590'), (9, 19, '10', 5, '16'), (10, 2, '1', 6, '7590'), (11, 2, '1', 7, '7590'), (12, 18, '1', 7, '12890'), (13, 20, '1', 9, '120000'), (14, 2, '1', 11, '40000'), (15, 9, '1', 12, '40000'), (16, 1, '1', 12, '40000'), (17, 19, '1', 12, '15000'), (18, 21, '1', 13, '120000'), (19, 10, '1', 14, '40000'); -- -------------------------------------------------------- -- -- Table structure for table `orders` -- CREATE TABLE `orders` ( `id` int(11) NOT NULL, `uid` int(11) NOT NULL, `totalprice` varchar(255) NOT NULL, `orderstatus` varchar(255) NOT NULL, `paymentmode` varchar(255) NOT NULL, `timestamp` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `orders` -- INSERT INTO `orders` (`id`, `uid`, `totalprice`, `orderstatus`, `paymentmode`, `timestamp`) VALUES (1, 2, '80', 'Order Placed', 'cod', '2017-10-28 12:22:36'), (2, 2, '42060', 'Order Placed', 'cod', '2017-10-28 12:27:16'), (3, 6, '21980', 'Cancelled', 'cod', '2017-10-28 14:25:23'), (4, 6, '12965', 'In Progress', 'cod', '2017-10-28 14:28:29'), (5, 6, '7750', 'In Progress', 'cod', '2017-11-06 19:40:34'), (6, 7, '7590', 'Order Placed', 'cod', '2018-10-22 10:10:46'), (7, 7, '20480', 'Order Placed', 'on', '2018-10-22 11:14:04'), (8, 7, '0', 'Cancelled', 'on', '2018-10-22 11:46:51'), (9, 7, '120000', 'Dispatched', 'cod', '2018-10-22 12:01:33'), (10, 7, '0', 'In Progress', 'cod', '2018-10-22 13:10:47'), (11, 7, '40000', 'Order Placed', 'cod', '2018-10-22 15:17:04'), (12, 7, '95000', 'Order Placed', 'cod', '2018-10-22 15:41:07'), (13, 8, '0', 'Order Placed', 'cod', '2018-10-22 16:14:21'), (14, 8, '40000', 'Order Placed', 'on', '2018-10-22 16:15:31'); -- -------------------------------------------------------- -- -- Table structure for table `ordertracking` -- CREATE TABLE `ordertracking` ( `id` int(11) NOT NULL, `orderid` int(11) NOT NULL, `status` varchar(255) NOT NULL, `message` text NOT NULL, `timestamp` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `ordertracking` -- INSERT INTO `ordertracking` (`id`, `orderid`, `status`, `message`, `timestamp`) VALUES (3, 3, 'Cancelled', ' I don&#39;t want this item now.', '2017-10-28 17:54:18'), (5, 4, 'In Progress', ' Order is in Progress', '2017-10-30 13:31:08'), (6, 5, 'In Progress', ' Order is in Progress', '2017-11-06 19:45:11'), (7, 8, 'Cancelled', ' ', '2018-10-22 12:22:14'), (8, 10, 'In Progress', ' the product has been delivered', '2018-10-22 13:49:50'), (9, 9, 'Dispatched', ' delivery in 5 days', '2018-10-22 13:50:15'); -- -------------------------------------------------------- -- -- Table structure for table `products` -- CREATE TABLE `products` ( `product_id` int(100) NOT NULL, `product_cat` int(100) NOT NULL, `product_title` varchar(255) NOT NULL, `product_price` int(100) NOT NULL, `product_desc` text NOT NULL, `product_image` text NOT NULL, `product_keywords` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `products` -- INSERT INTO `products` (`product_id`, `product_cat`, `product_title`, `product_price`, `product_desc`, `product_image`, `product_keywords`) VALUES (1, 0, 'Classic Sofa 1', 40000, '<p>asdadfgfhjgjhj</p>', '37.jpg', 'sofa, clasic, 2 seater'), (2, 1, 'King Size', 40000, '<p>king size bed 6X6 in size</p>', '30.jpg', 'kingsize, bed'), (3, 2, 'High Back chair', 15000, 'comfort for your office', '31.jpg', 'office seat, high back, leather seat'), (4, 4, 'Round Table', 40000, '<p>dinning round table for a family of 8</p>', '6.jpg', 'dinning, round table'), (5, 7, 'Bedroom set', 120000, '<p>complete bedroom set, kingsize bed, chest, shoe rack</p>', '18.jpg', 'bed, king size,chest'), (6, 2, 'Arm Chair', 15000, '<p>arm chair brown in color single seater</p>', '17.jpg', 'arm chair, single seater'), (7, 3, 'L Shape Sofa', 40000, '<p>Leather white L-Shape, sofa</p>', '15.jpg', 'Leather, L-shape, Sofa'), (8, 1, 'Bed 2', 45000, '<p>bed 2</p>', '28.jpg', 'bed'), (9, 1, 'product 19', 40000, '<p>product 19</p>', '19.jpg', 'product 19'), (10, 3, 'product 2', 40000, '<p>product 2</p>', '2.jpg', 'sofa, clasic, 2 seater'), (12, 5, 'Product 7', 45000, '<p>Office desk</p>', '7.jpg', 'office, desk'), (13, 4, 'table 1', 15000, '<p>table table table</p>', '9.jpg', 'table, round'), (14, 3, 'Product 38', 120000, '<p>sofa white, royal</p>', '38.jpg', 'sofa, royal'), (15, 3, 'Product 39', 40000, '<p>lazy chair, maharaja</p>', '39.jpg', 'maharaja, lazy chair'), (16, 2, 'Product 36', 15000, '<p>out door, school seats</p>', '36.jpg', 'Out door, chair, school'), (17, 2, 'Product 35', 15000, '<p>chair</p>', '35.jpg', 'arm chair, single seater'), (18, 3, 'Classic Sofa', 120000, '<p>recliner</p>', '4.jpg', 'sofa, clasic, 2 seater'), (19, 2, 'Product 34', 15000, '<p>short back office chair, color block</p>', '34.jpg', 'office chair, chair'), (20, 3, 'Classic Sofa', 120000, '<p>jghgjhg</p>', '2.jpg', 'sofa, clasic, 2 seater'), (21, 3, 'Classic Sofa', 120000, 'sofa sofa', '4.jpg', 'sofa, clasic, 2 seater'), (22, 3, 'Classic Sofa', 120000, 'sofa sofa', '4.jpg', 'sofa, clasic, 2 seater'), (23, 1, 'King Size', 40000, 'bed', '21.jpg', 'bed, king size'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(11) NOT NULL, `email` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `timestamp` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `email`, `password`, `timestamp`) VALUES (1, 'vivek@codingcyber.com', '26e0eca228b42a520565415246513c0d', '2017-10-27 12:05:10'), (2, 'vivek1@codingcyber.com', '$2y$10$cMzHNUFGKma96MywHmVMbekuJZb1tSNLsevHzLnSRbcRicQVhEC6a', '2017-10-27 12:24:25'), (6, 'vivek2@codingcyber.com', '$2y$10$apI7l.1wAS5pgbG4YfMrN.jNd5T3XmhecFuSV2M6UNdoUHImPXNxm', '2017-10-27 12:28:20'), (7, 'starixc@gmail.com', '$2y$10$tc5kQ8voWvAiZHst1P97ju/pBPCS6RnGJ1jZsY61Ss2Fef6GYF3eK', '2018-10-22 10:10:16'), (8, 'evans@gmail.com', '$2y$10$5jmP7aNcQ8Z0fpEcb7aJOehnVhurFKWxYZ77.B2LqylEbcSmAmKmK', '2018-10-22 16:13:13'); -- -------------------------------------------------------- -- -- Table structure for table `usersmeta` -- CREATE TABLE `usersmeta` ( `id` int(11) NOT NULL, `uid` int(11) NOT NULL, `firstname` varchar(255) NOT NULL, `lastname` varchar(255) NOT NULL, `company` varchar(255) NOT NULL, `address1` varchar(255) NOT NULL, `address2` varchar(255) NOT NULL, `city` varchar(255) NOT NULL, `state` varchar(255) NOT NULL, `country` varchar(255) NOT NULL, `zip` varchar(255) NOT NULL, `mobile` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `usersmeta` -- INSERT INTO `usersmeta` (`id`, `uid`, `firstname`, `lastname`, `company`, `address1`, `address2`, `city`, `state`, `country`, `zip`, `mobile`) VALUES (1, 2, 'Vivek', 'V', 'Coding Cyber', 'Hyd', 'Hyd', 'Hyderabad', 'Telangana', '', '500060', ''), (2, 6, 'Vivek', 'Vengala', 'Coding Cyber', '#201', 'DSNR', 'Hyderabad', 'Telangana', '', '500060', '9876543211'), (3, 7, 'chris', 'erricks', 'starixc', '124 nakuru', 'highway towers ', 'nakuru', 'nakuru', 'SOM', '20100', '0712748950'), (4, 8, 'Evans ', 'Kamau', 'Mwanzo', 'oginga odinga nakuru', 'gido plaza', 'nakuru', 'nakuru', 'SOM', '20100', '0725698574'); -- -------------------------------------------------------- -- -- Table structure for table `wishlist` -- CREATE TABLE `wishlist` ( `id` int(11) NOT NULL, `pid` int(11) NOT NULL, `uid` int(11) NOT NULL, `timestamp` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `wishlist` -- INSERT INTO `wishlist` (`id`, `pid`, `uid`, `timestamp`) VALUES (1, 1, 6, '2017-10-30 16:36:45'), (2, 2, 6, '2017-10-30 16:38:07'), (3, 21, 6, '2017-11-06 19:42:35'), (5, 8, 7, '2018-10-22 15:56:04'); -- -- Indexes for dumped tables -- -- -- Indexes for table `admin` -- ALTER TABLE `admin` ADD PRIMARY KEY (`id`); -- -- Indexes for table `categories` -- ALTER TABLE `categories` ADD PRIMARY KEY (`cat_id`); -- -- Indexes for table `orderitems` -- ALTER TABLE `orderitems` ADD PRIMARY KEY (`id`); -- -- Indexes for table `orders` -- ALTER TABLE `orders` ADD PRIMARY KEY (`id`); -- -- Indexes for table `ordertracking` -- ALTER TABLE `ordertracking` ADD PRIMARY KEY (`id`); -- -- Indexes for table `products` -- ALTER TABLE `products` ADD PRIMARY KEY (`product_id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `email` (`email`); -- -- Indexes for table `usersmeta` -- ALTER TABLE `usersmeta` ADD PRIMARY KEY (`id`); -- -- Indexes for table `wishlist` -- ALTER TABLE `wishlist` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `admin` -- ALTER TABLE `admin` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `categories` -- ALTER TABLE `categories` MODIFY `cat_id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `orderitems` -- ALTER TABLE `orderitems` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20; -- -- AUTO_INCREMENT for table `orders` -- ALTER TABLE `orders` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15; -- -- AUTO_INCREMENT for table `ordertracking` -- ALTER TABLE `ordertracking` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `products` -- ALTER TABLE `products` MODIFY `product_id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `usersmeta` -- ALTER TABLE `usersmeta` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `wishlist` -- ALTER TABLE `wishlist` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
c5143645eeae8755594f52079b08453dacb68bab
SQL
rukiyedemirci/ORACLE-KODLUYORUZ
/RUKİYE_QUERY/BANKING_QUERY.sql
ISO-8859-9
1,070
3.875
4
[]
no_license
--Yln 4. aylarnda en ok hangi amala kredi ekilmi?tir? SELECT COUNT(L.purpose),l.purpose FROM TRANSACTIONS T INNER JOIN ACCOUNTS A ON T.account_d = A.account_d INNER JOIN LOANS L ON L.account_d = A.account_d WHERE L.month = 4 group by l.purpose; --Hangi yllarda ka hesap almtr? select count(account_d) as Hesap_Numaras ,year as Yl from accounts group by year order by 2 ; -- lemlerin tiplerine gre toplam saylarnn bykten ke sralamas nedir?- select count(type) as ISLEM_SAYISI, type AS ISLEM_TURU from transactons group by type; -- lemlerin tiplerine gre toplam tutarlarnn bykten ke sralamas nedir? select COUNT(BALANCE)AS TOPLAM_TUTAR ,TYPE AS ISLEM_TUR FROM transactons GROUP BY TYPE ORDER BY 1; -- Bankann 50 ve ya 51 yanda kadn mterilerinden ayn isme sahip olan mterisi/mterileri var m? Varsa isimleri neler? select COUNT(DISTINCT FIRST),FIRST from clents where AGE BETWEEN 50 AND 51 AND SEX = 'Female' GROUP BY FIRST;
true
b22c87acb5feb241c9b7b8687f0895b81d65806d
SQL
dapser75/BBDDModulo5MYSQL
/youtube.sql
UTF-8
14,481
3.296875
3
[]
no_license
-- MySQL Script generated by MySQL Workbench -- Wed Jan 27 10:28:52 2021 -- Model: New Model Version: 1.0 -- MySQL Workbench Forward Engineering SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'; -- ----------------------------------------------------- -- Schema youtube -- ----------------------------------------------------- DROP SCHEMA IF EXISTS `youtube` ; -- ----------------------------------------------------- -- Schema youtube -- ----------------------------------------------------- CREATE SCHEMA IF NOT EXISTS `youtube` DEFAULT CHARACTER SET utf8 ; USE `youtube` ; -- ----------------------------------------------------- -- Table `youtube`.`tb_pais` -- ----------------------------------------------------- DROP TABLE IF EXISTS `youtube`.`tb_pais` ; CREATE TABLE IF NOT EXISTS `youtube`.`tb_pais` ( `idtb_pais` INT NOT NULL AUTO_INCREMENT, `pais` VARCHAR(45) NULL, `iso_pais2` VARCHAR(2) NULL, `iso_pais3` VARCHAR(3) NULL, PRIMARY KEY (`idtb_pais`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `youtube`.`tb_provincia` -- ----------------------------------------------------- DROP TABLE IF EXISTS `youtube`.`tb_provincia` ; CREATE TABLE IF NOT EXISTS `youtube`.`tb_provincia` ( `idtb_provincia` INT NOT NULL AUTO_INCREMENT, `codprovincia` VARCHAR(5) NULL, `nomprovincia` VARCHAR(45) NULL, `pais` INT NULL, PRIMARY KEY (`idtb_provincia`), INDEX `fk_provincia_pais_id_idx` (`pais` ASC) VISIBLE, CONSTRAINT `fk_provincia_pais_id` FOREIGN KEY (`pais`) REFERENCES `youtube`.`tb_pais` (`idtb_pais`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `youtube`.`tb_codigopostal` -- ----------------------------------------------------- DROP TABLE IF EXISTS `youtube`.`tb_codigopostal` ; CREATE TABLE IF NOT EXISTS `youtube`.`tb_codigopostal` ( `idtb_codigopostal` INT NOT NULL AUTO_INCREMENT, `codigopostal` VARCHAR(45) NULL, `poblacion` VARCHAR(45) NULL, `idprovincia` INT NULL, `idpais` INT NULL, PRIMARY KEY (`idtb_codigopostal`), INDEX `fk_codpostal_pais_id_idx` (`idpais` ASC) VISIBLE, INDEX `fk_codpostal_provincia_id_idx` (`idprovincia` ASC) VISIBLE, CONSTRAINT `fk_codpostal_pais_id` FOREIGN KEY (`idpais`) REFERENCES `youtube`.`tb_pais` (`idtb_pais`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_codpostal_provincia_id` FOREIGN KEY (`idprovincia`) REFERENCES `youtube`.`tb_provincia` (`idtb_provincia`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `youtube`.`tb_usuario` -- ----------------------------------------------------- DROP TABLE IF EXISTS `youtube`.`tb_usuario` ; CREATE TABLE IF NOT EXISTS `youtube`.`tb_usuario` ( `id_usuario` INT NOT NULL AUTO_INCREMENT, `nombreapellidos` VARCHAR(150) NULL, `nombreusuario` VARCHAR(45) NULL, `email` VARCHAR(45) NULL, `fechanacimiento` DATE NULL, `sexo` TINYINT(1) NULL, `password` VARCHAR(45) NULL, `idpais` INT NULL, `idcodigopostal` INT NULL, UNIQUE INDEX `email_UNIQUE` (`email` ASC) VISIBLE, PRIMARY KEY (`id_usuario`), INDEX `fk_usuario_codpostal_id_idx` (`idcodigopostal` ASC) VISIBLE, INDEX `fk_usuario_pais_id_idx` (`idpais` ASC) VISIBLE, CONSTRAINT `fk_usuario_codpostal_id` FOREIGN KEY (`idcodigopostal`) REFERENCES `youtube`.`tb_codigopostal` (`idtb_codigopostal`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_usuario_pais_id` FOREIGN KEY (`idpais`) REFERENCES `youtube`.`tb_pais` (`idtb_pais`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `youtube`.`tb_estadosvideo` -- ----------------------------------------------------- DROP TABLE IF EXISTS `youtube`.`tb_estadosvideo` ; CREATE TABLE IF NOT EXISTS `youtube`.`tb_estadosvideo` ( `id_estadosvideo` INT(2) NOT NULL AUTO_INCREMENT, `estado` VARCHAR(45) NULL, PRIMARY KEY (`id_estadosvideo`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `youtube`.`tb_videos` -- ----------------------------------------------------- DROP TABLE IF EXISTS `youtube`.`tb_videos` ; CREATE TABLE IF NOT EXISTS `youtube`.`tb_videos` ( `id_video` INT NOT NULL AUTO_INCREMENT, `titulo` VARCHAR(45) NOT NULL, `descripcion` VARCHAR(250) NOT NULL, `tamano` INT NULL, `archivo` VARCHAR(150) NULL, `duracion` TIME NULL, `thumbnail` BLOB NULL, `reproducciones` INT NULL, `estadosvideo_id` INT NULL DEFAULT 03, PRIMARY KEY (`id_video`), INDEX `estadosvideo_idx_idx` (`estadosvideo_id` ASC) VISIBLE, CONSTRAINT `fk_estadosvideo_id` FOREIGN KEY (`estadosvideo_id`) REFERENCES `youtube`.`tb_estadosvideo` (`id_estadosvideo`) ON DELETE RESTRICT ON UPDATE RESTRICT) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `youtube`.`tb_videospublicados` -- ----------------------------------------------------- DROP TABLE IF EXISTS `youtube`.`tb_videospublicados` ; CREATE TABLE IF NOT EXISTS `youtube`.`tb_videospublicados` ( `usuario_id` INT NOT NULL, `video_id` INT NOT NULL, `fecha` TIMESTAMP NULL, PRIMARY KEY (`video_id`, `usuario_id`), INDEX `video_idx_idx` (`video_id` ASC) VISIBLE, CONSTRAINT `fk_videospub_usuario_id` FOREIGN KEY (`usuario_id`) REFERENCES `youtube`.`tb_usuario` (`id_usuario`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_videospub_video_id` FOREIGN KEY (`video_id`) REFERENCES `youtube`.`tb_videos` (`id_video`) ON DELETE RESTRICT ON UPDATE CASCADE) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `youtube`.`tb_etiquetas_video` -- ----------------------------------------------------- DROP TABLE IF EXISTS `youtube`.`tb_etiquetas_video` ; CREATE TABLE IF NOT EXISTS `youtube`.`tb_etiquetas_video` ( `id_etiquetas_video` INT NOT NULL AUTO_INCREMENT, `nombreetiqueta` VARCHAR(45) NOT NULL DEFAULT 'Video', PRIMARY KEY (`id_etiquetas_video`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `youtube`.`tb_videosyetiquetas` -- ----------------------------------------------------- DROP TABLE IF EXISTS `youtube`.`tb_videosyetiquetas` ; CREATE TABLE IF NOT EXISTS `youtube`.`tb_videosyetiquetas` ( `video_id` INT NOT NULL, `etiquetas_video_id` INT NOT NULL, PRIMARY KEY (`video_id`, `etiquetas_video_id`), INDEX `etiquetas_video_idx_idx` (`etiquetas_video_id` ASC) VISIBLE, CONSTRAINT `fk_vidyeti_video_id` FOREIGN KEY (`video_id`) REFERENCES `youtube`.`tb_videos` (`id_video`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_vidyeti_etiquetas_video_id` FOREIGN KEY (`etiquetas_video_id`) REFERENCES `youtube`.`tb_etiquetas_video` (`id_etiquetas_video`) ON DELETE RESTRICT ON UPDATE CASCADE) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `youtube`.`tb_canal` -- ----------------------------------------------------- DROP TABLE IF EXISTS `youtube`.`tb_canal` ; CREATE TABLE IF NOT EXISTS `youtube`.`tb_canal` ( `id_canal` INT NOT NULL AUTO_INCREMENT, `usuario_id` INT NULL, `nombre_canal` VARCHAR(45) NULL, `descripcion_canal` VARCHAR(250) NULL, `fecha_creacion` DATETIME NULL, PRIMARY KEY (`id_canal`), INDEX `usuario_idx_idx` (`usuario_id` ASC) VISIBLE, CONSTRAINT `fk_canal_usuario_id` FOREIGN KEY (`usuario_id`) REFERENCES `youtube`.`tb_usuario` (`id_usuario`) ON DELETE RESTRICT ON UPDATE CASCADE) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `youtube`.`tb_subscripcioncanal` -- ----------------------------------------------------- DROP TABLE IF EXISTS `youtube`.`tb_subscripcioncanal` ; CREATE TABLE IF NOT EXISTS `youtube`.`tb_subscripcioncanal` ( `canal_id` INT NOT NULL, `usuario_id` INT NOT NULL, PRIMARY KEY (`canal_id`, `usuario_id`), INDEX `usuario_idx_idx` (`usuario_id` ASC) VISIBLE, CONSTRAINT `fk_subscripcion_canal_id` FOREIGN KEY (`canal_id`) REFERENCES `youtube`.`tb_canal` (`id_canal`) ON DELETE RESTRICT ON UPDATE CASCADE, CONSTRAINT `fk_subscripcion_usuario_id` FOREIGN KEY (`usuario_id`) REFERENCES `youtube`.`tb_usuario` (`id_usuario`) ON DELETE RESTRICT ON UPDATE CASCADE) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `youtube`.`tb_like_dislike` -- ----------------------------------------------------- DROP TABLE IF EXISTS `youtube`.`tb_like_dislike` ; CREATE TABLE IF NOT EXISTS `youtube`.`tb_like_dislike` ( `id_like_dislike` TINYINT NOT NULL, `descripcion` VARCHAR(45) NULL, PRIMARY KEY (`id_like_dislike`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `youtube`.`tb_resgistrolikevideos` -- ----------------------------------------------------- DROP TABLE IF EXISTS `youtube`.`tb_resgistrolikevideos` ; CREATE TABLE IF NOT EXISTS `youtube`.`tb_resgistrolikevideos` ( `video_id` INT NOT NULL, `usuario_id` INT NOT NULL, `like_dislike_id` TINYINT NULL, `fecha` DATETIME NULL, INDEX `like_dislike_idx_idx` (`like_dislike_id` ASC) VISIBLE, PRIMARY KEY (`usuario_id`, `video_id`), INDEX `fk_video_id_idx` (`video_id` ASC) VISIBLE, CONSTRAINT `fk_registro_like_dislike_id` FOREIGN KEY (`like_dislike_id`) REFERENCES `youtube`.`tb_like_dislike` (`id_like_dislike`) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT `fk_registro_video_id` FOREIGN KEY (`video_id`) REFERENCES `youtube`.`tb_videos` (`id_video`) ON DELETE RESTRICT ON UPDATE CASCADE, CONSTRAINT `fk_registro_usuario_id` FOREIGN KEY (`usuario_id`) REFERENCES `youtube`.`tb_usuario` (`id_usuario`) ON DELETE RESTRICT ON UPDATE CASCADE) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `youtube`.`tb_comentariovideo` -- ----------------------------------------------------- DROP TABLE IF EXISTS `youtube`.`tb_comentariovideo` ; CREATE TABLE IF NOT EXISTS `youtube`.`tb_comentariovideo` ( `id_comentariovideo` INT NOT NULL AUTO_INCREMENT, `usuario_id` INT NULL, `video_id` INT NULL, `comentario` VARCHAR(400) NULL, `fecha` DATETIME NULL, PRIMARY KEY (`id_comentariovideo`), INDEX `usuario_idx_idx` (`usuario_id` ASC) VISIBLE, INDEX `video_idx_idx` (`video_id` ASC) VISIBLE, CONSTRAINT `fk_comentario_usuario_id` FOREIGN KEY (`usuario_id`) REFERENCES `youtube`.`tb_usuario` (`id_usuario`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_comentrario_video_id` FOREIGN KEY (`video_id`) REFERENCES `youtube`.`tb_videos` (`id_video`) ON DELETE CASCADE ON UPDATE CASCADE) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `youtube`.`tb_likescomentarios` -- ----------------------------------------------------- DROP TABLE IF EXISTS `youtube`.`tb_likescomentarios` ; CREATE TABLE IF NOT EXISTS `youtube`.`tb_likescomentarios` ( `comentariovideo_id` INT NOT NULL, `usuario_id` INT NOT NULL, `like_dislike_id` TINYINT NULL, `fecha` DATETIME NULL DEFAULT now(), PRIMARY KEY (`comentariovideo_id`, `usuario_id`), INDEX `like_dislike_idx_idx` (`like_dislike_id` ASC) VISIBLE, INDEX `fk_lc_usuario_id_idx` (`usuario_id` ASC) VISIBLE, CONSTRAINT `fk_lc_like_dislike_id` FOREIGN KEY (`like_dislike_id`) REFERENCES `youtube`.`tb_like_dislike` (`id_like_dislike`) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT `fk_lc_comentariovideo_id` FOREIGN KEY (`comentariovideo_id`) REFERENCES `youtube`.`tb_comentariovideo` (`id_comentariovideo`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_lc_usuario_id` FOREIGN KEY (`usuario_id`) REFERENCES `youtube`.`tb_usuario` (`id_usuario`) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `youtube`.`tb_playliststatus` -- ----------------------------------------------------- DROP TABLE IF EXISTS `youtube`.`tb_playliststatus` ; CREATE TABLE IF NOT EXISTS `youtube`.`tb_playliststatus` ( `id_playliststatus` TINYINT NOT NULL, `status` VARCHAR(45) NULL, PRIMARY KEY (`id_playliststatus`)) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `youtube`.`tb_playlist` -- ----------------------------------------------------- DROP TABLE IF EXISTS `youtube`.`tb_playlist` ; CREATE TABLE IF NOT EXISTS `youtube`.`tb_playlist` ( `id_playlist` INT NOT NULL AUTO_INCREMENT, `usuario_id` INT NULL, `playlistname` VARCHAR(45) NULL, `playlistdate` DATE NULL, `playliststatus_id` TINYINT NULL, PRIMARY KEY (`id_playlist`), INDEX `fk_usuario_idx_idx` (`usuario_id` ASC) VISIBLE, INDEX `fk_playliststatus_idx` (`playliststatus_id` ASC) VISIBLE, CONSTRAINT `fk_playlist_usuario_id` FOREIGN KEY (`usuario_id`) REFERENCES `youtube`.`tb_usuario` (`id_usuario`) ON DELETE RESTRICT ON UPDATE CASCADE, CONSTRAINT `fk_playlist_playliststatus_id` FOREIGN KEY (`playliststatus_id`) REFERENCES `youtube`.`tb_playliststatus` (`id_playliststatus`) ON DELETE RESTRICT ON UPDATE RESTRICT) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `youtube`.`tb_videosplaylist` -- ----------------------------------------------------- DROP TABLE IF EXISTS `youtube`.`tb_videosplaylist` ; CREATE TABLE IF NOT EXISTS `youtube`.`tb_videosplaylist` ( `playlist_id` INT NOT NULL, `video_id` INT NOT NULL, PRIMARY KEY (`playlist_id`, `video_id`), INDEX `fk_video_id_idx` (`video_id` ASC) VISIBLE, CONSTRAINT `fk_videos_playlist_id` FOREIGN KEY (`playlist_id`) REFERENCES `youtube`.`tb_playlist` (`id_playlist`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk_videos_video_id` FOREIGN KEY (`video_id`) REFERENCES `youtube`.`tb_videos` (`id_video`) ON DELETE RESTRICT ON UPDATE CASCADE) ENGINE = InnoDB; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
true
3145ab5c9fb69a152cab7db454983a25ffdfbee9
SQL
MichaelDevenport/chromotype_test
/db/structure.sql
UTF-8
10,174
3.25
3
[ "MIT" ]
permissive
-- -- PostgreSQL database dump -- SET statement_timeout = 0; SET lock_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SET check_function_bodies = false; SET client_min_messages = warning; -- -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: - -- CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; -- -- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: - -- COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; SET search_path = public, pg_catalog; SET default_tablespace = ''; SET default_with_oids = false; -- -- Name: asset_tags; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE asset_tags ( asset_id integer, tag_id integer, visitor character varying(255), created_at timestamp without time zone, updated_at timestamp without time zone ); -- -- Name: asset_urls; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE asset_urls ( id integer NOT NULL, asset_id integer, url character varying(2000), url_sha character varying(40), created_at timestamp without time zone, updated_at timestamp without time zone ); -- -- Name: asset_urls_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE asset_urls_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: asset_urls_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE asset_urls_id_seq OWNED BY asset_urls.id; -- -- Name: asset_urns; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE asset_urns ( id integer NOT NULL, asset_url_id integer, urn character varying(200) ); -- -- Name: asset_urns_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE asset_urns_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: asset_urns_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE asset_urns_id_seq OWNED BY asset_urns.id; -- -- Name: assets; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE assets ( id integer NOT NULL, type character varying(255), favorite boolean, hidden boolean, name character varying(255), caption character varying(255), description character varying(255), taken_at timestamp without time zone, lost_at timestamp without time zone, lat double precision, lng double precision, visited_by_version integer, created_at timestamp without time zone, updated_at timestamp without time zone ); -- -- Name: assets_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE assets_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: assets_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE assets_id_seq OWNED BY assets.id; -- -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE schema_migrations ( version character varying(255) NOT NULL ); -- -- Name: settings; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE settings ( id integer NOT NULL, key character varying(255), value text, created_at timestamp without time zone, updated_at timestamp without time zone ); -- -- Name: settings_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE settings_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: settings_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE settings_id_seq OWNED BY settings.id; -- -- Name: tag_hierarchies; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE tag_hierarchies ( ancestor_id integer, descendant_id integer, generations integer ); -- -- Name: tags; Type: TABLE; Schema: public; Owner: -; Tablespace: -- CREATE TABLE tags ( id integer NOT NULL, type character varying(255), parent_id integer, name character varying(255), description character varying(255), pk integer, created_at timestamp without time zone, updated_at timestamp without time zone ); -- -- Name: tags_id_seq; Type: SEQUENCE; Schema: public; Owner: - -- CREATE SEQUENCE tags_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -- -- Name: tags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - -- ALTER SEQUENCE tags_id_seq OWNED BY tags.id; -- -- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY asset_urls ALTER COLUMN id SET DEFAULT nextval('asset_urls_id_seq'::regclass); -- -- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY asset_urns ALTER COLUMN id SET DEFAULT nextval('asset_urns_id_seq'::regclass); -- -- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY assets ALTER COLUMN id SET DEFAULT nextval('assets_id_seq'::regclass); -- -- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY settings ALTER COLUMN id SET DEFAULT nextval('settings_id_seq'::regclass); -- -- Name: id; Type: DEFAULT; Schema: public; Owner: - -- ALTER TABLE ONLY tags ALTER COLUMN id SET DEFAULT nextval('tags_id_seq'::regclass); -- -- Name: asset_urls_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY asset_urls ADD CONSTRAINT asset_urls_pkey PRIMARY KEY (id); -- -- Name: asset_urns_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY asset_urns ADD CONSTRAINT asset_urns_pkey PRIMARY KEY (id); -- -- Name: assets_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY assets ADD CONSTRAINT assets_pkey PRIMARY KEY (id); -- -- Name: settings_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY settings ADD CONSTRAINT settings_pkey PRIMARY KEY (id); -- -- Name: tags_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace: -- ALTER TABLE ONLY tags ADD CONSTRAINT tags_pkey PRIMARY KEY (id); -- -- Name: asset_url_sha_udx; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE UNIQUE INDEX asset_url_sha_udx ON asset_urls USING btree (url_sha); -- -- Name: asset_url_urn_udx; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE UNIQUE INDEX asset_url_urn_udx ON asset_urns USING btree (asset_url_id, urn); -- -- Name: asset_urn_idx; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX asset_urn_idx ON asset_urns USING btree (urn); -- -- Name: index_asset_tags_on_asset_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_asset_tags_on_asset_id ON asset_tags USING btree (asset_id); -- -- Name: index_asset_tags_on_tag_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_asset_tags_on_tag_id ON asset_tags USING btree (tag_id); -- -- Name: index_asset_tags_on_tag_id_and_asset_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE UNIQUE INDEX index_asset_tags_on_tag_id_and_asset_id ON asset_tags USING btree (tag_id, asset_id); -- -- Name: index_settings_on_key; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE UNIQUE INDEX index_settings_on_key ON settings USING btree (key); -- -- Name: index_tag_hierarchies_on_ancestor_id_and_descendant_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE UNIQUE INDEX index_tag_hierarchies_on_ancestor_id_and_descendant_id ON tag_hierarchies USING btree (ancestor_id, descendant_id); -- -- Name: index_tag_hierarchies_on_descendant_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE INDEX index_tag_hierarchies_on_descendant_id ON tag_hierarchies USING btree (descendant_id); -- -- Name: index_tags_on_name_and_parent_id; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE UNIQUE INDEX index_tags_on_name_and_parent_id ON tags USING btree (name, parent_id); -- -- Name: unique_schema_migrations; Type: INDEX; Schema: public; Owner: -; Tablespace: -- CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations USING btree (version); -- -- Name: asset_tags_asset_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY asset_tags ADD CONSTRAINT asset_tags_asset_id_fk FOREIGN KEY (asset_id) REFERENCES assets(id); -- -- Name: asset_tags_tag_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY asset_tags ADD CONSTRAINT asset_tags_tag_id_fk FOREIGN KEY (tag_id) REFERENCES tags(id); -- -- Name: asset_urls_asset_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY asset_urls ADD CONSTRAINT asset_urls_asset_id_fk FOREIGN KEY (asset_id) REFERENCES assets(id); -- -- Name: asset_urns_asset_url_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY asset_urns ADD CONSTRAINT asset_urns_asset_url_id_fk FOREIGN KEY (asset_url_id) REFERENCES asset_urls(id); -- -- Name: tag_hierarchies_ancestor_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY tag_hierarchies ADD CONSTRAINT tag_hierarchies_ancestor_id_fk FOREIGN KEY (ancestor_id) REFERENCES tags(id); -- -- Name: tag_hierarchies_descendant_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY tag_hierarchies ADD CONSTRAINT tag_hierarchies_descendant_id_fk FOREIGN KEY (descendant_id) REFERENCES tags(id); -- -- Name: tags_parent_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- ALTER TABLE ONLY tags ADD CONSTRAINT tags_parent_id_fk FOREIGN KEY (parent_id) REFERENCES tags(id); -- -- PostgreSQL database dump complete -- SET search_path TO "$user",public; INSERT INTO schema_migrations (version) VALUES ('20110518055213'); INSERT INTO schema_migrations (version) VALUES ('20110525180630'); INSERT INTO schema_migrations (version) VALUES ('20110525221314'); INSERT INTO schema_migrations (version) VALUES ('20110526005214'); INSERT INTO schema_migrations (version) VALUES ('20120103032104'); INSERT INTO schema_migrations (version) VALUES ('20121128020835');
true
7445d3569bf7c418ac83398ab107d5f064cee3e1
SQL
ArnaudW29/projet1TIrhum
/BACKEND/scripts-db/creation-table/tbUnite.sql
UTF-8
236
2.796875
3
[]
no_license
/* ARNAUD WAETERMANS creation de la table avec les unites */ CREATE TABLE tbUnite ( uniteId INTEGER NOT NULL DEFAULT AUTOINCREMENT, uniteNom VARCHAR(15) NOT NULL, uniteSymbole VARCHAR(3) NULL, CONSTRAINT pk_tbUnite PRIMARY KEY (uniteId) );
true
7151c66a7e21ac8ff55927600dae32c2246b0ebc
SQL
fflch/dados
/Queries/conta_beneficios.sql
UTF-8
202
3.09375
3
[]
no_license
SELECT count(bc.dtainiccd) FROM LOCALIZAPESSOA l JOIN BENEFICIOALUCONCEDIDO bc ON l.codpes = bc.codpes WHERE bc.dtainiccd LIKE '%__ano__%' AND l.codundclg = 8 AND bc.codbnfalu = __beneficio__
true
6878a7c03c6f932faf4aac8e32dac10df5cbf6a1
SQL
QuyenLy87/release-validation-framework
/importer/src/main/resources/scripts/file-centric/file-centric-snapshot-association-valid-targetcomponentid.sql
UTF-8
676
3.234375
3
[ "Apache-2.0" ]
permissive
/******************************************************************************** file-centric-snapshot-association-valid-targetcomponentid Assertion: TargetComponentId refers to valid concepts in the ASSOCIATION REFSET snapshot file. ********************************************************************************/ insert into qa_result (runid, assertionuuid, concept_id, details) select <RUNID>, '<ASSERTIONUUID>', a.referencedcomponentid, concat('ASSOC RS: Targetcomponentid=',a.targetcomponentid, ':Invalid TargetComponentId.') from curr_associationrefset_s a left join curr_concept_s b on a.targetcomponentid = b.id where b.id is null; commit;
true
dea2cdb9a9b10b6ee0707873a86d792915ef5fdc
SQL
aborngra/apex-connect-2017
/HR_WM/050_Indexes/LOC_CITY_IX.sql
UTF-8
533
3.21875
3
[]
no_license
/* This anonymous block creates a index named LOC_CITY_IX PL/SQL Block is restartable, so it can be executed n times, but only creates the index if it does not exist. %author ABO %created 2017-04-19 22:16:13 */ DECLARE v_index_name user_indexes.index_name%TYPE := 'LOC_CITY_IX'; BEGIN FOR i IN (SELECT v_index_name FROM DUAL MINUS SELECT index_name FROM user_indexes) LOOP EXECUTE IMMEDIATE q'[ CREATE INDEX "LOC_CITY_IX" ON "LOCATIONS" ("CITY") ]' ; END LOOP; END; /
true
70fc5f79698075eb95c3107c090fcfa4113c4547
SQL
bearcheese/itm-blog
/itm-java/itm-common/mysql-schema.ddl
UTF-8
2,528
4.4375
4
[]
no_license
alter table comments drop foreign key comments_user_id_fk; alter table comments drop foreign key comments_post_id_fk; alter table posts drop foreign key posts_author_fk; drop table if exists comments; drop table if exists contact_messages; drop table if exists posts; drop table if exists users; create table comments ( id bigint not null auto_increment, created_at datetime, updated_at datetime, content varchar(255) not null, post_id bigint not null, user_id bigint not null, primary key (id) ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci; create table contact_messages ( id bigint not null auto_increment, created_at datetime, updated_at datetime, checked bit not null, email varchar(255), message varchar(255), name varchar(255), subject varchar(255), primary key (id) ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci; create table posts ( id bigint not null auto_increment, created_at datetime, updated_at datetime, category varchar(255), comments_allowed bit, content longtext not null, publish_date datetime, published bit not null, slug varchar(255), summary longtext not null, title varchar(255) not null, author_id bigint not null, primary key (id) ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci; create table users ( id bigint not null auto_increment, created_at datetime, updated_at datetime, admin bit not null, email varchar(255) not null unique, hashed_password varchar(255), name varchar(255) not null unique, salt varchar(255), primary key (id) ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci; alter table comments add index comments_user_id_fk (user_id), add constraint comments_user_id_fk foreign key (user_id) references users (id); alter table comments add index comments_post_id_fk (post_id), add constraint comments_post_id_fk foreign key (post_id) references posts (id); alter table posts add index posts_author_fk (author_id), add constraint posts_author_fk foreign key (author_id) references users (id);
true
fd4e62650e30f81a9aaca5f1d3264b6060bc7db4
SQL
premsingh4github/japanconsultancy
/routes/cast_chubi_system (4).sql
UTF-8
95,477
2.8125
3
[ "MIT" ]
permissive
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Mar 23, 2019 at 09:24 AM -- Server version: 10.2.22-MariaDB -- PHP Version: 7.2.7 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `cast_chubi_system` -- -- -------------------------------------------------------- -- -- Table structure for table `attendances` -- CREATE TABLE `attendances` ( `id` int(10) UNSIGNED NOT NULL, `student_id` int(10) UNSIGNED NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `attendances` -- INSERT INTO `attendances` (`id`, `student_id`, `created_at`, `updated_at`) VALUES (1, 11, '2019-03-23 10:09:11', '2019-03-23 10:09:11'), (2, 3, '2019-03-23 10:09:51', '2019-03-23 10:09:51'), (3, 60, '2019-03-23 10:09:53', '2019-03-23 10:09:53'), (4, 44, '2019-03-23 10:09:56', '2019-03-23 10:09:56'), (5, 5, '2019-03-23 10:10:02', '2019-03-23 10:10:02'), (6, 4, '2019-03-23 10:10:07', '2019-03-23 10:10:07'), (7, 5, '2019-03-23 10:10:41', '2019-03-23 10:10:41'), (8, 5, '2019-03-23 10:10:44', '2019-03-23 10:10:44'), (9, 4, '2019-03-23 10:10:47', '2019-03-23 10:10:47'), (10, 44, '2019-03-23 10:10:49', '2019-03-23 10:10:49'), (11, 60, '2019-03-23 10:10:50', '2019-03-23 10:10:50'), (12, 3, '2019-03-23 10:10:52', '2019-03-23 10:10:52'), (13, 121, '2019-03-23 10:44:23', '2019-03-23 10:44:23'); -- -------------------------------------------------------- -- -- Table structure for table `batches` -- CREATE TABLE `batches` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `batches` -- INSERT INTO `batches` (`id`, `name`, `created_at`, `updated_at`) VALUES (1, '2019', '2019-02-19 13:38:20', '2019-02-19 13:38:20'), (2, '2018', '2019-02-20 07:19:46', '2019-02-20 07:19:46'); -- -------------------------------------------------------- -- -- Table structure for table `categories` -- CREATE TABLE `categories` ( `id` int(10) UNSIGNED NOT NULL, `category_name` varchar(191) COLLATE utf8_unicode_ci NOT NULL, `category_description` varchar(191) COLLATE utf8_unicode_ci DEFAULT NULL, `category_status` enum('Active','UnActive') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'UnActive', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `categories` -- INSERT INTO `categories` (`id`, `category_name`, `category_description`, `category_status`, `created_at`, `updated_at`) VALUES (1, 'Electronic Devices', NULL, 'Active', '2019-01-03 12:24:53', '2019-01-03 12:24:53'), (2, 'Electronic Accessories', NULL, 'Active', '2019-01-03 12:25:17', '2019-01-03 12:48:00'), (3, 'TV & Home Appliances', NULL, 'Active', '2019-01-03 12:25:39', '2019-01-03 12:48:00'), (4, 'Health & Beauty', NULL, 'Active', '2019-01-03 12:25:55', '2019-01-03 12:47:59'), (5, 'Babies & Toys', NULL, 'Active', '2019-01-03 12:26:10', '2019-01-03 12:47:52'), (6, 'groceries & Pets', NULL, 'Active', '2019-01-03 12:26:35', '2019-01-03 12:47:52'), (7, 'Home & Lifestyle', NULL, 'Active', '2019-01-03 12:26:54', '2019-01-03 12:47:51'), (8, 'Women\'s Fashion', NULL, 'Active', '2019-01-03 12:27:12', '2019-01-03 12:47:51'), (9, 'Watches & Accessories', NULL, 'Active', '2019-01-03 12:27:34', '2019-01-03 12:47:56'), (10, 'Sports & Outdoor', NULL, 'Active', '2019-01-03 12:28:00', '2019-01-03 12:47:50'), (11, 'Automotive & Motorbike', NULL, 'Active', '2019-01-03 12:28:21', '2019-01-03 12:47:49'); -- -------------------------------------------------------- -- -- Table structure for table `class_batch_sections` -- CREATE TABLE `class_batch_sections` ( `id` int(10) UNSIGNED NOT NULL, `class_batch_id` int(11) NOT NULL, `section_id` int(11) NOT NULL, `shift` enum('morning','day') COLLATE utf8mb4_unicode_ci NOT NULL, `start_date` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `end_date` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `class_batch_sections` -- INSERT INTO `class_batch_sections` (`id`, `class_batch_id`, `section_id`, `shift`, `start_date`, `end_date`, `created_at`, `updated_at`) VALUES (1, 1, 1, 'morning', '2019-03-09', '2019-03-28', '2019-02-19 13:38:51', '2019-02-19 13:38:51'), (4, 1, 6, 'morning', '2019-03-19', '2019-12-20', '2019-03-19 05:34:52', '2019-03-19 05:34:52'), (5, 1, 1, 'morning', '2019-03-23', '2019-07-31', '2019-03-23 17:53:27', '2019-03-23 17:53:27'), (6, 1, 6, 'day', '2019-03-23', '2019-09-20', '2019-03-23 17:54:27', '2019-03-23 17:54:27'), (7, 2, 1, 'morning', '2019-03-23', '2019-08-16', '2019-03-23 17:55:03', '2019-03-23 17:55:03'), (8, 2, 6, 'day', '2019-03-23', '2019-10-18', '2019-03-23 17:55:25', '2019-03-23 17:55:25'); -- -------------------------------------------------------- -- -- Table structure for table `class_batch_subjects` -- CREATE TABLE `class_batch_subjects` ( `id` int(10) UNSIGNED NOT NULL, `class_batch_id` int(11) NOT NULL, `subject_id` int(11) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `class_rooms` -- CREATE TABLE `class_rooms` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `class_rooms` -- INSERT INTO `class_rooms` (`id`, `name`, `created_at`, `updated_at`) VALUES (1, 'Batch', '2019-02-20 07:29:45', '2019-02-27 10:27:55'), (3, 'A', '2019-03-23 17:48:46', '2019-03-23 17:48:46'), (4, 'B', '2019-03-23 17:49:39', '2019-03-23 17:49:39'); -- -------------------------------------------------------- -- -- Table structure for table `class_room_batches` -- CREATE TABLE `class_room_batches` ( `id` int(10) UNSIGNED NOT NULL, `class_room_id` int(11) NOT NULL, `batch_id` int(11) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `class_room_batches` -- INSERT INTO `class_room_batches` (`id`, `class_room_id`, `batch_id`, `created_at`, `updated_at`) VALUES (1, 1, 1, '2019-02-19 13:38:26', '2019-02-19 13:38:26'), (2, 1, 2, '2019-02-26 18:49:53', '2019-02-26 18:49:53'), (3, 3, 1, '2019-03-23 17:49:54', '2019-03-23 17:49:54'), (4, 4, 1, '2019-03-23 17:50:11', '2019-03-23 17:50:11'), (5, 3, 2, '2019-03-23 17:50:21', '2019-03-23 17:50:21'), (6, 4, 2, '2019-03-23 17:50:27', '2019-03-23 17:50:27'); -- -------------------------------------------------------- -- -- Table structure for table `class_section_days` -- CREATE TABLE `class_section_days` ( `id` int(10) UNSIGNED NOT NULL, `class_section_id` int(11) DEFAULT NULL, `day` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `class_section_students` -- CREATE TABLE `class_section_students` ( `id` int(10) UNSIGNED NOT NULL, `class_section_id` int(11) NOT NULL, `student_id` int(11) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `class_section_students` -- INSERT INTO `class_section_students` (`id`, `class_section_id`, `student_id`, `created_at`, `updated_at`) VALUES (1, 1, 3, '2019-02-19 13:39:15', '2019-02-19 13:39:15'), (2, 1, 4, '2019-02-19 13:39:15', '2019-02-19 13:39:15'), (3, 1, 5, '2019-02-19 13:39:15', '2019-02-19 13:39:15'), (4, 1, 41, '2019-02-23 11:30:41', '2019-02-23 11:30:41'), (5, 1, 44, '2019-02-23 12:04:00', '2019-02-23 12:04:00'), (6, 1, 8, '2019-03-09 12:31:43', '2019-03-09 12:31:43'), (7, 1, 60, '2019-03-10 18:30:34', '2019-03-10 18:30:34'); -- -------------------------------------------------------- -- -- Table structure for table `countries` -- CREATE TABLE `countries` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `countries` -- INSERT INTO `countries` (`id`, `name`, `created_at`, `updated_at`) VALUES (1, 'Nepal', '2019-02-13 13:43:38', '2019-02-13 13:43:38'), (2, 'Japan', '2019-02-13 13:43:38', '2019-02-13 13:43:38'), (3, 'Uzbekistan', NULL, NULL), (4, 'Vietnam', NULL, NULL), (5, 'China', NULL, NULL), (6, 'Korea', NULL, NULL), (7, 'Srilanka', NULL, NULL), (8, 'Mynmar', NULL, NULL), (9, 'Bangladesh', NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `holidays` -- CREATE TABLE `holidays` ( `id` int(10) UNSIGNED NOT NULL, `title` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `description` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL, `date` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `migrations` -- INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1, '2014_10_12_000000_create_users_table', 1), (2, '2014_10_12_100000_create_password_resets_table', 1), (3, '2019_01_22_142948_create_roles_table', 1), (4, '2019_01_22_143333_update_users_table', 1), (5, '2019_01_24_064926_create_class_rooms_table', 1), (6, '2019_01_24_065141_create_batches_table', 1), (7, '2019_01_24_065805_create_class_room_batches_table', 1), (8, '2019_01_26_034501_create_sections_table', 1), (9, '2019_01_26_034713_create_subjects_table', 1), (10, '2019_01_28_064842_create_teachers_table', 1), (11, '2019_01_31_045628_create_class_batch_sections_table', 1), (12, '2019_01_31_050710_create_class_batch_subjects_table', 1), (13, '2019_01_31_051135_create_class_section_students_table', 1), (14, '2019_01_31_051659_create_student_optionals_table', 1), (15, '2019_02_04_112743_create_holidays_table', 1), (16, '2019_02_05_035306_create_class_section_days_table', 1), (17, '2019_02_05_043024_create_students_table', 1), (18, '2019_02_06_073442_create_country_table', 1), (19, '2019_02_06_080139_create_section_periods_table', 1), (20, '2019_02_06_081934_create_attendances_table', 1), (21, '2019_02_13_153747_create_residensal_card_times_table', 1); -- -------------------------------------------------------- -- -- Table structure for table `password_resets` -- CREATE TABLE `password_resets` ( `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `residensal_card_times` -- CREATE TABLE `residensal_card_times` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `residensal_card_times` -- INSERT INTO `residensal_card_times` (`id`, `name`, `created_at`, `updated_at`) VALUES (1, '6 Month', '2019-02-14 01:43:41', '2019-02-14 01:43:41'), (2, '1 Year', '2019-02-14 01:43:55', '2019-02-14 01:43:55'), (3, '1year6month', '2019-02-14 01:44:28', '2019-02-15 07:11:10'), (4, '2年', '2019-02-14 18:30:12', '2019-02-14 18:30:12'), (5, '1year3month', '2019-02-15 07:09:42', '2019-02-15 07:09:42'), (6, '2year3month', '2019-02-15 07:10:07', '2019-02-15 07:10:07'); -- -------------------------------------------------------- -- -- Table structure for table `roles` -- CREATE TABLE `roles` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `roles` -- INSERT INTO `roles` (`id`, `name`, `created_at`, `updated_at`) VALUES (1, 'admin', '2019-02-13 13:43:38', '2019-02-13 13:43:38'), (2, 'staff', '2019-02-13 13:43:38', '2019-02-13 13:43:38'); -- -------------------------------------------------------- -- -- Table structure for table `sections` -- CREATE TABLE `sections` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `sections` -- INSERT INTO `sections` (`id`, `name`, `created_at`, `updated_at`) VALUES (1, 'A', '2019-02-19 13:36:20', '2019-03-19 05:30:00'), (6, 'B', '2019-03-19 05:30:13', '2019-03-19 05:30:13'), (7, 'C', '2019-03-19 05:30:24', '2019-03-19 05:30:24'), (8, 'D', '2019-03-19 05:30:42', '2019-03-19 05:33:16'); -- -------------------------------------------------------- -- -- Table structure for table `section_periods` -- CREATE TABLE `section_periods` ( `id` int(10) UNSIGNED NOT NULL, `c_s_id` int(10) UNSIGNED NOT NULL, `date` date NOT NULL, `start_at` timestamp NULL DEFAULT NULL, `end_at` timestamp NULL DEFAULT NULL, `teacher_id` int(11) DEFAULT NULL, `user_id` int(11) DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `students` -- CREATE TABLE `students` ( `id` int(10) UNSIGNED NOT NULL, `last_student_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `first_student_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `last_student_japanese_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `first_student_japanese_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `class_room_batch_id` int(11) DEFAULT NULL, `student_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `residensal_card` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `student_sex` enum('m','f','o') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'm', `country_id` int(11) DEFAULT NULL, `date_of_birth` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `entry_date` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `expire_date` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `residensalCardTime` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `residensal_card_expire` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `address` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `personal_phone_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `part_time_job_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `phone_where_they_works` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `address_where_they_works` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `nearest_station` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `student_note` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `unique_id` int(11) DEFAULT NULL, `subject_optional_id` int(11) DEFAULT NULL, `photo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `student_of_year` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `nearest_station1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `student_status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '留学', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `students` -- INSERT INTO `students` (`id`, `last_student_name`, `first_student_name`, `last_student_japanese_name`, `first_student_japanese_name`, `class_room_batch_id`, `student_number`, `residensal_card`, `student_sex`, `country_id`, `date_of_birth`, `entry_date`, `expire_date`, `residensalCardTime`, `residensal_card_expire`, `address`, `personal_phone_number`, `part_time_job_name`, `phone_where_they_works`, `address_where_they_works`, `nearest_station`, `student_note`, `unique_id`, `subject_optional_id`, `photo`, `student_of_year`, `nearest_station1`, `student_status`, `created_at`, `updated_at`) VALUES (3, 'TAMANG', 'SUNITA', 'タマン', 'スニタ', 1, '19154', 'PN41216042EA', 'f', 1, '1995-02-28', '2019-04-02', '2020-03-31', '1', '2021-04-20', '東京都板橋区舟渡3-13-15 レオパレスリベール404号室', '090-4418-4315', 'マクドナルド西荻窪店', '03-3395-7076', '新宿区百人町1丁目20-3バラードハイム新宿渡辺ビル201', '西荻窪駅', NULL, 1917603, 1, '0.44812500 1550125476.jpg', '第1学年', NULL, '留学', '2019-02-14 12:24:36', '2019-03-09 11:14:00'), (4, 'KHADKA', 'ISHWOR', 'カドカ ', 'イソル', 1, '19131', 'PN73206078EA', 'm', 1, '1993-03-28', '2019-04-02', '2020-03-31', '2', '2019-08-17', '東京都新宿区北新宿3-9-17 藤本荘105号室', '070-2021-7322', NULL, NULL, NULL, NULL, NULL, 1911604, NULL, '0.10385400 1550137471.jpg', '第1学年', NULL, '留学', '2019-02-14 15:44:31', '2019-03-09 11:03:14'), (5, 'OLI', 'GHANSHYAM', 'オリ', 'ガンシャム', 1, '19132', 'PN12268002EA', 'm', 1, '1995-02-27', '2019-04-02', '2020-03-31', '2', '2019-08-17', '東京都新宿区大久保1-12-21 第8コート新宿205号室', '070-4211-5701', NULL, NULL, NULL, NULL, NULL, 1968925, NULL, '0.50599500 1550144225.jpg', '第1学年', NULL, '留学', '2019-02-14 17:37:05', '2019-03-09 11:03:32'), (6, 'BHUJEL', 'AASHIS', 'ブジェル', 'アシス', 1, '19133', 'EG22093323RD', 'm', 1, '1997-12-07', '2019-04-02', '2020-03-31', '4', '2019-07-13', '山口県萩市大字椿東3000-10 専門学校さくら国際言語学院寮', '070-7566-4635', '㈱博多魚嘉 仙崎事業所', '0837-23-3940', '山口県長門市東深川駅前643-1', '長門市駅', NULL, 1955126, NULL, '0.05643400 1550144533.jpg', '第1学年', NULL, '留学', '2019-02-14 17:42:13', '2019-03-09 11:03:57'), (7, 'GURUNG', 'RITA', 'グルン', 'リタ', 1, '19134', 'EG75220312RD', 'f', 1, '1996-03-16', '2019-04-02', '2020-03-31', '4', '2019-07-13', '山口県萩市大字椿東3000-10 専門学校さくら国際言語学院寮', '080-2944-2447', NULL, NULL, NULL, NULL, NULL, 1955027, 1, '0.43374700 1550147375.jpg', '第1学年', NULL, '留学', '2019-02-14 18:29:35', '2019-03-09 11:04:19'), (8, 'GURUNG', 'RAKHI', 'グルン', 'ラキ', 1, '19101', 'PN70772073EA', 'f', 1, '1992-10-10', '2019-04-02', '2026-07-09', '1', '2019-07-23', '東京都新宿区北新宿1-16-3 せぴあ館201号室', '090-9327-2694', '羽田クロノゲート ヤマト運輸㈱', '03-6756-7165', '東京都大田区羽田旭町11-1', NULL, NULL, 1942148, 1, '0.33817200 1550161107.jpg', '第1学年', NULL, '留学', '2019-02-14 22:18:27', '2019-03-15 17:08:18'), (9, 'GHARTHI MAGAR', 'CHANDRA PRASAD', 'ガルティ マガル', 'チャンドラ プラサド', 1, '19102', 'PN63129511EA', 'm', 1, '1996-09-29', '2019-04-02', '2020-03-31', NULL, '2019-04-13', '東京都新宿区百人町1-22-20 トミイビル201号室', '070-2172-1441', '羽田クロノゲート ヤマト運輸㈱', '03-6756-7165', '東京都大田区羽田旭町11-1', NULL, NULL, 1934709, 1, '0.79334600 1550168461.jpg', '第1学年', NULL, '留学', '2019-02-15 00:21:01', '2019-03-09 10:47:07'), (10, 'TOSHPULATOV', 'UTKUR', 'トシプラトフ', 'ウタクロ', 1, '19103', 'PN93263573FA', 'm', 3, '1990-05-13', '2019-04-02', '2020-03-31', NULL, '2019-04-04', '東京都新宿区北新宿4-3-11 ユモドスクエア北新宿205号室', '080-9299-2618', 'セブン-イレブン 新大久保駅西店', '03-5386-0053', '東京都新宿区百人町1-15-21', NULL, NULL, 19620210, NULL, '0.09463300 1550170318.jpg', '第1学年', NULL, '留学', '2019-02-15 00:51:58', '2019-03-09 10:47:22'), (11, 'LE VAN', 'DINH', 'レ ヴァン', 'ジン', 1, '19104', 'PN92620182EA', 'm', 4, '1997-08-24', '2019-04-02', '2020-03-31', '2', '2019-08-14', '東京都新宿区下落合4-22-13 林ビル301号室', '070-4316-5928', NULL, NULL, NULL, NULL, NULL, 19552211, NULL, '0.44048600 1550171284.jpg', '第1学年', NULL, '留学', '2019-02-15 01:08:04', '2019-03-09 10:47:39'), (12, 'PETHTHA MESTIYAGE CHAMINDA', 'DESHAPPRIYA', 'ペッタ メシヤゲ チャミンダ', 'テシャピカ', 1, '19105', 'PN06306158EA', 'm', 7, '1989-06-27', '2019-04-02', '2020-03-31', '1', '2019-05-06', '東京都豊島区南長崎3-31-5 パラゼット南長崎101号室', '070-4806-8944', '新東京ベース店 ヤマト運輸㈱', '03-3799-6138', '東京都品川区八潮3-2-35', '品川駅', NULL, 19514512, 1, '0.40055500 1550172143.jpg', '第1学年', NULL, '留学', '2019-02-15 01:22:23', '2019-03-09 10:47:53'), (13, 'RAUT', 'SUNIL', 'ラウト', 'スニル', 1, '19106', 'PN68524925EA', 'm', 1, '1992-11-25', '2019-04-02', '2020-03-31', '2', '2019-07-26', '東京都新宿区北新宿4-16-11 パルフェ北新宿101号室', '090-4244-8144', '神奈川ベース店 ヤマト運輸㈱', '045-500-5149', '神奈川県横浜市鶴見区安善町1-1-1 ', '安善町駅', NULL, 19930713, NULL, '0.84067700 1550172551.jpg', '第1学年', NULL, '留学', '2019-02-15 01:29:11', '2019-03-09 10:48:13'), (14, 'SEN THAKURI', 'BISHAL', 'セン タクリ', 'ビサル', 1, '19107', 'PN71777011EA', 'm', 1, '1997-01-09', '2019-04-02', '2020-03-31', '1', '2019-04-19', '東京都新宿区北新宿4-28-1-202', '080-6640-8080', 'マクドナルド赤坂駅前店', '03-3585-0306', '東京都港区赤坂5-4-5', '赤坂駅', NULL, 19984414, 1, '0.85404900 1550173135.jpg', '第1学年', NULL, '留学', '2019-02-15 01:38:55', '2019-03-09 10:48:39'), (15, 'NGUYEN HOAI', 'NAM', 'グウェン ホアイ', 'ナム', 1, '19108', 'PN66442530EA', 'm', 4, '1998-01-26', '2019-04-02', '2020-03-31', '2', '2019-07-05', '東京都足立区小台2-20-17 クレイノODAIYOU 204号室', '070-4984-1550', '羽田クロノゲート ヤマト運輸㈱', '03-6756-7165', '東京都大田区羽田旭町11-1', '穴守稲荷駅', NULL, 19556115, NULL, '0.69904200 1550174084.jpg', '第1学年', NULL, '留学', '2019-02-15 01:54:44', '2019-03-09 10:48:58'), (16, 'TAMANG', 'ARTHA BAHADUR', 'タマン', 'アルタ バハドゥル', 1, '19109', 'EG04304647FA', 'm', 1, '1993-04-14', '2019-04-02', '2020-03-31', '5', '2019-02-04', '東京都豊島区北大塚2-22-4 巣鴨新田アパート2F', '080-6785-2095', NULL, NULL, NULL, NULL, NULL, 19641516, NULL, '0.51910600 1550174536.jpg', '第1学年', NULL, '留学', '2019-02-15 02:02:16', '2019-03-09 10:49:20'), (17, 'TURSUNOV', 'DALER', 'テウルスノブ', 'ダレル', 1, '19110', 'PN15437670EA', 'm', 3, '1995-02-04', '2019-04-02', '2020-03-31', '1', '2019-03-31', '東京都豊島区巣鴨5-39-5 ローベンハイツ巣鴨102号室', '080-8163-6671', '東京法人営業支店 ヤマト運輸㈱', '03-5564-3734', '東京都江東区有明1-6-26', '田町駅', NULL, 19999117, 1, '0.32542900 1550175058.jpg', '第1学年', NULL, '留学', '2019-02-15 02:10:58', '2019-03-09 10:49:42'), (18, 'PANDAY', 'NAGILA SIRJANA', 'パンディ', 'ナギラ シルジャナ', 1, '19135', 'EG71484718GA', 'f', 1, '1992-03-21', '2019-04-02', '2020-03-31', '4', '2019-12-10', '東京都新宿区高田馬場3-25-21 昇峰ハイム2 103号室', '080-5678-2981', '羽田クロノゲート ヤマト運輸㈱', '03-6756-7165', '東京都大田区羽田旭町11-1', '穴守稲荷駅', NULL, 19775218, NULL, '0.26102100 1550192689.jpg', '第1学年', NULL, '留学', '2019-02-15 07:04:49', '2019-03-09 11:04:37'), (19, 'LE QUANG', 'MINH', 'レ クアン ', 'ミン', 1, '19155', 'PN24114958GA', 'm', 4, '1995-12-24', '2019-04-02', '2020-03-31', NULL, '2019-04-12', '埼玉県吉川市木売2-12-5 吉田ハイツ101号室', NULL, '新東京ベース店 ヤマト運輸㈱', '03-3799-6138', '東京都品川区八潮3-2-35', '品川駅', NULL, 19938019, NULL, '0.70806700 1550193356.jpg', '第1学年', NULL, '留学', '2019-02-15 07:15:56', '2019-03-09 11:15:23'), (20, 'VU', 'NHAT GIANG', 'ブー', ' ニャット ヤン', 1, '19136', 'PN09509491EA', 'm', 4, '1998-06-11', '2019-04-02', '2020-03-31', '2', '2019-07-05', '埼玉県戸田市川岸3-5-8 レオパレスシルフィー206号室', '070-4453-7055', NULL, NULL, NULL, NULL, NULL, 19818420, NULL, '0.61034100 1550193424.jpg', '第1学年', NULL, '留学', '2019-02-15 07:17:04', '2019-03-09 11:05:02'), (21, 'SILWAL', 'ADHIKARI RASMITA', 'シルワル', ' アディカリ ラスミタ', 1, '19137', 'PN38018037EA', 'f', 1, '1995-03-24', '2019-04-02', '2020-03-31', '2', '2019-08-21', '東京都豊島区千早1-14-14', '080-5046-8933', NULL, NULL, NULL, NULL, NULL, 19731121, NULL, '0.79908900 1550193705.jpg', '第1学年', NULL, '留学', '2019-02-15 07:21:45', '2019-03-09 11:05:16'), (22, 'GURUNG', 'KABITA', 'グルン ', 'カビタ', 1, '19156', 'EG94302119FA', 'f', 1, '1993-01-01', '2019-04-02', '2020-03-31', '5', '2019-02-23', '東京都豊島区千早1-36-6 ライベスト池袋Ⅱ 103号室', '080-5416-1993', '㈱東京オペレーションパートナーズ', '03-5757-9339', '東京都大田区羽田空港3-1-1 W1棟', '羽田空港国内線ターミナル', NULL, 19728622, NULL, '0.79855800 1550194189.jpg', '第1学年', NULL, '留学', '2019-02-15 07:29:49', '2019-03-09 11:15:47'), (23, 'G C', 'ANJALI', 'ジーシー アンザリ', 'アンザリ', 1, '19138', 'PN40763483EA', 'f', 1, '1997-05-02', '2019-04-02', '2020-03-31', '1', '2019-05-12', '東京都板橋区板橋1-26-1ハイツヤギシタ202号室', '070-2192-0230', '磯丸水産 人形町店', '03-5643-7580', '東京都中央区日本橋人形町1-4-10 人形町センタービル1F', '都営浅草線 人形町駅', NULL, 19145523, 1, '0.90494100 1550194240.jpg', '第1学年', NULL, '留学', '2019-02-15 07:30:40', '2019-03-09 11:05:39'), (24, 'GURUNG', 'CHOK NARAYAN', 'グルン ', 'チョク ナラヤン', 1, '19157', 'PN06877467EA', 'm', 1, '1992-09-15', '2019-04-02', '2020-03-31', '2', '2019-07-23', '東京都中野区中央3-16-15 アスパ中野101号室', '080-1736-6295', 'ファミリーマート 武蔵小杉駅北口店', '044-739-0380', '神奈川県川崎市中原区小杉町1-403-60', '武蔵小杉駅', NULL, 19481724, NULL, '0.39886600 1550194447.jpg', '第1学年', NULL, '留学', '2019-02-15 07:34:07', '2019-03-09 11:16:02'), (25, 'K C', 'PRADEEP', 'ケーシー ', 'プラディプ', 1, '19139', 'PN10871573GA', 'm', 1, '1991-11-02', '2019-04-02', '2020-03-31', '5', '2019-04-10', '東京都新宿区北新宿3-5-16 セドルハイム304号室', '070-4533-8549', 'マクドナルド 恵比寿駅前店', '03-3444-0762', '東京都渋谷区恵比寿1-10-10', '恵比寿駅', NULL, 19803225, NULL, '0.35400000 1550194484.jpg', '第1学年', NULL, '留学', '2019-02-15 07:34:44', '2019-03-09 11:05:53'), (26, 'SAPKOTA', 'PRATIMA', 'サプコタ ', 'プロティマ', 1, '19158', 'PN36757165EA', 'f', 1, '1992-11-03', '2019-04-02', '2020-03-31', '2', '2019-07-26', '東京都新宿区北新宿1-27-6 カーサ島田203号室', '090-4175-7158', NULL, NULL, NULL, NULL, NULL, 19331626, NULL, '0.41637400 1550194635.jpg', '第1学年', NULL, '留学', '2019-02-15 07:37:15', '2019-03-09 11:16:17'), (27, 'KUMESTHERU', 'ARACHCHIGE NISANKA PUSHPA KUMARA', 'クメステル ', 'アラッチゲ ニサンカ プシュパ クマラ', 1, '19140', 'EG70950466FA', 'm', 7, '1991-01-22', '2019-04-02', '2020-03-31', '5', '2018-12-28', '千葉県市川市下新宿22-18 藤ハイツ101号室', '080-9299-4305', NULL, NULL, NULL, NULL, NULL, 19564927, NULL, '0.42765800 1550194665.jpg', '第1学年', NULL, '留学', '2019-02-15 07:37:45', '2019-03-09 11:06:12'), (28, 'PARAJULI', 'TILAK RAM', 'パラズリ ', 'ティラク ラム', 1, '19141', 'PN50869392EA', 'm', 1, '1996-02-21', '2019-04-02', '2020-03-31', '2', '2019-08-01', '東京都豊島区池袋3-37-7 太考荘201号室', '080-9351-3885', NULL, NULL, NULL, NULL, NULL, 19504228, NULL, '0.99624400 1550194830.jpg', '第1学年', NULL, '留学', '2019-02-15 07:40:30', '2019-03-09 11:06:36'), (29, 'NGUYEN', 'VIET CUONG', 'グエン ', 'ヴィエット クオン', 1, '19159', 'PN05828883GA', 'm', 4, '1988-06-10', '2019-04-02', '2020-03-31', '5', '2019-04-11', '東京都新宿区新宿7-6-13 東山荘102号室', '090-1543-1988', '新東京ベース店 ヤマト運輸㈱', '03-3799-6138', '東京都品川区八潮3-2-35', '品川駅', NULL, 19108829, NULL, '0.59843400 1550194878.jpg', '第1学年', NULL, '留学', '2019-02-15 07:41:18', '2019-03-09 11:16:34'), (30, 'PAUDEL', 'SARITA', 'パウデル', ' サリタ', 1, '19142', 'PN19455353EA', 'f', 1, '1990-09-26', '2019-04-02', '2020-03-31', '1', '2019-04-15', '東京都大田区西六郷1-14-2 ストーク西六郷203号室', '090-9345-9417', NULL, NULL, NULL, NULL, NULL, 19589330, 1, '0.39722300 1550195070.jpg', '第1学年', NULL, '留学', '2019-02-15 07:44:30', '2019-03-09 11:08:08'), (31, 'PHAM', 'THI LAM', 'ファム ', 'ティ ラム', 1, '19160', 'PN30155268FA', 'f', 4, '1996-12-28', '2019-04-02', '2020-03-31', '5', '2019-04-18', '東京都新宿区北新宿1-30-30-112', '080-1050-6886', '三洋ビル管理株式会社', '03-6417-4810', '東京都目黒区下目黒1-6-20 明治安田生命目黒ビル2F', '品川駅', NULL, 19170031, NULL, '0.12096900 1550195129.jpg', '第1学年', NULL, '留学', '2019-02-15 07:45:29', '2019-03-09 11:25:14'), (32, 'KC', 'EROJ', 'ケーシー ', 'イロズ', 1, '19161', 'PN80130165EA', 'm', 1, '1998-01-27', '2019-04-02', '2020-03-31', '5', '2019-02-09', '東京都新宿区北新宿4−28−1−202', '080-9812-1624', '株式会社慶和', '0422-49-3221', '東京都武蔵野市吉祥寺南2-4-18', 'JR吉祥寺駅', NULL, 19214732, NULL, '0.91806800 1550195314.jpg', '第1学年', NULL, '留学', '2019-02-15 07:48:34', '2019-03-09 11:25:32'), (33, 'PAUDEL', 'SUNIL', 'パウデル ', 'スニル', 1, '19162', 'PN51499103EA', 'm', 1, '1998-11-27', '2019-04-02', '2020-03-31', '2', '2019-07-19', '東京都新宿区北新宿4−28−1−302', '080-6544-7164', '池尻大橋駅北店 FamilyMart', '03-5779-5206', '東京都目黒区大橋2-24-1', '池尻大橋駅', NULL, 19104533, NULL, '0.03700200 1550195474.jpg', '第1学年', NULL, '留学', '2019-02-15 07:51:14', '2019-03-09 11:26:04'), (34, 'SHRESTHA', 'DURGA', 'セレスタ ', 'ドゥルガ', 1, '19163', 'DU98866323FA', 'f', 1, '1995-09-05', '2019-04-02', '2020-03-31', '6', '2019-01-03', '埼玉県蕨市南町2-6-17 第3エンゼルハイツ103号室', '080-4194-9843', NULL, NULL, NULL, NULL, NULL, 19271634, NULL, '0.19616200 1550195617.jpg', '第1学年', NULL, '留学', '2019-02-15 07:53:37', '2019-03-09 11:26:18'), (35, 'KC', 'REBATI', 'ケーシー ', 'レバティ', 1, '19164', 'PN42832830ED', 'f', 1, '1993-05-14', '2019-04-02', '2020-03-31', '1', '2019-05-26', '埼玉県志木市本町5-5-15 第2志木ハイツ105号室', '070-3536-1855', NULL, NULL, NULL, NULL, NULL, 19425435, 1, '0.79215000 1550195755.jpg', '第1学年', NULL, '留学', '2019-02-15 07:55:55', '2019-03-09 11:26:38'), (36, 'KHADKA', 'GAURI', 'カドカ ', 'ゴウリ', 1, '19165', 'EG15582984EA', 'f', 1, '1994-02-10', '2019-04-02', '2020-03-31', '5', '2019-01-25', '東京都豊島区東池袋2-48-3 コーポ87 203号室', '080-5902-2560', NULL, NULL, NULL, NULL, NULL, 19439036, NULL, '0.61135800 1550195866.jpg', '第1学年', NULL, '留学', '2019-02-15 07:57:46', '2019-03-09 11:26:53'), (37, 'THAPA', 'SITA', 'タパ ', 'シタ', 1, '19166', 'EG05656748GA', 'f', 1, '1998-01-25', '2019-04-02', '2020-03-31', '5', '2019-02-15', '東京都豊島区池袋3-20-9 サクラハウス201号室', '090-3599-7793', NULL, NULL, NULL, NULL, NULL, 19796237, NULL, '0.74297500 1550196018.jpg', '第1学年', NULL, '留学', '2019-02-15 08:00:18', '2019-03-09 11:27:13'), (38, 'POUDEL', 'ANKIT', 'パウダル ', 'アンキト', 1, '19167', 'PN60722394EA', 'm', 1, '1996-01-13', '2019-04-02', '2020-03-31', '2', '2019-08-28', '神奈川県川崎市川崎区本町2-11-4 河原崎荘201号室', '070-3884-9384', '㈱東京オペレーションパートナーズ', '03-5757-9339', '東京都大田区羽田空港3-1-1 W1棟', '羽田空港国内線ターミナル', NULL, 19331838, NULL, '0.13241200 1550196210.jpg', '第1学年', NULL, '留学', '2019-02-15 08:03:30', '2019-03-09 11:27:30'), (39, 'MIN', 'OO', 'ミン ', 'ウー', 1, '19168', 'PN21052569EA', 'm', 8, '1991-01-27', '2019-04-02', '2020-03-31', '1', '2019-04-10', '東京都新宿区大久保2-14-2 老本ビル4-B', '080-5035-9183', '秀山 (シュウザン)', '03-3354-6347', '東京都新宿区歌舞伎町1-2-2 サブナード地下街', '新宿駅', NULL, 19100039, 1, '0.01607100 1550196418.jpg', '第1学年', NULL, '留学', '2019-02-15 08:06:58', '2019-03-09 11:27:48'), (40, 'THAPA', 'SAMPADHA', 'タパ', ' サマパダ', 1, '19143', 'PN81445313EA', 'f', 1, '1998-08-16', '2019-04-02', '2020-03-31', '1', '2019-04-15', '東京都台東区入谷1-16-10', '090-9344-9186', NULL, NULL, NULL, NULL, NULL, 19109140, 1, '0.14523900 1550196476.jpg', '第1学年', NULL, '留学', '2019-02-15 08:07:56', '2019-03-09 11:09:12'), (41, 'SUBEDI', 'KRISHNA KUMARI', 'スベディ ', 'クリシュナ クマリ', 1, '19169', 'PN33103844EA', 'f', 1, '1989-09-06', '2019-04-02', '2020-03-31', '2', '2019-05-28', '東京都北区中里2-4-7 銀座コーポ202号室', '090-4240-1586', 'トオカツフーズ株式会社', '048-225-6711', '埼玉県川口市元郷4丁目5-1', '川口駅', NULL, 19382741, NULL, '0.10022700 1550196554.jpg', '第1学年', NULL, '留学', '2019-02-15 08:09:14', '2019-03-09 11:28:01'), (42, 'MAHARJAN', 'JAYASYA', 'マハラザン ', 'ザヤサ', 1, '19170', 'DU17933585FA', 'f', 1, '1995-08-28', '2019-04-02', '2020-03-31', '6', '2019-01-12', '埼玉県川口市中青木2-19-40 レオパレスクエールアピテ203号室', '070-3668-9817', 'ロイヤルホスト 九段下店', '03-3230-2251', '東京都千代田区九段北1-13-12 北の丸スクエア1F', '九段下駅', NULL, 19312242, NULL, '0.61742900 1550196711.jpg', '第1学年', NULL, '留学', '2019-02-15 08:11:51', '2019-03-09 11:28:15'), (43, 'PARIYAR', 'ROJINA', 'パリャラ', ' ロジナ', 1, '19144', 'PN25401703EA', 'f', 1, '1994-08-11', '2019-04-02', '2020-03-31', '1', '2019-06-17', '東京都江戸川区平井5-5-6 全観スカイハイツ203号室', '090-8442-3266', 'セブンイレブン 亀戸3丁目店', '03-3637-4513', '東京都江東区亀戸3丁目23-1', '亀戸駅', NULL, 19633643, 1, '0.41655000 1550196817.jpg', '第1学年', NULL, '留学', '2019-02-15 08:13:37', '2019-03-09 11:09:55'), (44, 'POUDEL', 'GANGA', 'ポウデル ', 'ガンガ', 1, '19171', 'PN02081266EA', 'f', 1, '1993-04-20', '2019-04-02', '2020-03-31', '1', '2018-10-16', '東京都大東区千束2-18-5 リケン303号室', '090-9648-6231', NULL, NULL, NULL, NULL, NULL, 19913844, 1, '0.65349600 1550196826.jpg', '第1学年', NULL, '留学', '2019-02-15 08:13:46', '2019-03-09 11:28:29'), (45, 'THAPA', 'CHHETRI SEEMA', 'タパ ', 'チェトリ シマ', 1, '19145', 'PN61062464EA', 'f', 1, '1994-11-29', '2019-04-02', '2020-03-31', '2', '2019-06-05', '東京都豊島区池袋3-20-9 サクラハウス201号室', '070-2157-9720', NULL, NULL, NULL, NULL, NULL, 19438645, NULL, '0.50423000 1550196968.jpg', '第1学年', NULL, '留学', '2019-02-15 08:16:08', '2019-03-09 11:10:10'), (46, 'RAI CHAMLING', 'YOGESH ROSHAN', 'ライ チャムリン ', 'ヨゲス ロスン', 1, '19172', 'PN20511030EA', 'm', 1, '1996-11-07', '2019-04-02', '2020-03-31', '2', '2019-08-20', '東京都北区田端新町1-23-3 ホワイトハイツ田端女子寮401号室', '080-5046-1863', '羽田クロノゲート ヤマト運輸㈱', '03-6756-7165', '東京都大田区羽田旭町11-1', '穴守稲荷駅', NULL, 19420846, NULL, '0.43205200 1550196977.jpg', '第1学年', NULL, '留学', '2019-02-15 08:16:17', '2019-03-09 11:28:41'), (47, 'OLI', 'PRAKASH', 'オリ ', 'プラカス', 1, '19173', 'PN79723505EA', 'm', 1, '1997-06-02', '2019-04-02', '2020-03-31', '5', '2019-01-30', '東京都新宿区北新宿4-28-1-202号室', '080-8153-1799', 'SGフィルダー㈱ ', '03-6834-2733', '東京都江東区青梅4-1-16', '東京テレポート駅', NULL, 19157947, NULL, '0.74807400 1550197227.jpg', '第1学年', NULL, '留学', '2019-02-15 08:20:27', '2019-03-09 11:28:59'), (48, 'LAMA', 'SANJEEV', 'ラマ', ' サンジバ', 1, '19146', 'PN57038201EA', 'm', 1, '1998-12-09', '2019-04-02', '2020-03-31', '1', '2019-05-20', '東京都新宿区上落合2-1-10 富士ビル206号室', '090-6348-6228', NULL, NULL, NULL, NULL, NULL, 19634748, 1, '0.53829200 1550197246.jpg', '第1学年', NULL, '留学', '2019-02-15 08:20:46', '2019-03-09 11:10:30'), (49, 'CHAUDHARY', 'NARESH', 'チョウダリ ', 'ナレス', 1, '19174', 'PN11978240EA', 'm', 1, '1997-05-15', '2019-04-02', '2020-03-31', '1', '2019-04-26', '東京都豊島区上池袋2-12-3 リーベルトシマ302号室', '070-3838-8021', '一軒め酒場 歌舞伎町一番街店', '03-5285-4080', '東京都新宿区歌舞伎町1-17-5 和田久ビル地下1階', '西部新宿駅', NULL, 19494549, 1, '0.59854400 1550197364.jpg', '第1学年', NULL, '留学', '2019-02-15 08:22:44', '2019-03-09 11:29:14'), (50, 'JAMKATTEL', 'GANESH', 'ザマカテル', 'ガネス', 1, '19147', 'PN91816085EA', 'm', 1, '1997-04-17', '2019-04-02', '2020-03-31', '2', '2019-07-20', '東京都豊島区池袋4-28-1 林マンション304号室', '080-5499-9008', NULL, NULL, NULL, NULL, NULL, 19167150, NULL, '0.41093500 1550197417.jpg', '第1学年', NULL, '留学', '2019-02-15 08:23:37', '2019-03-09 11:10:53'), (51, 'ADHIKARI', 'LAXMI', 'アディカリ ', 'ラクシュミ', 1, '19175', 'PN80108694EA', 'f', 1, '1997-12-26', '2019-04-02', '2020-03-31', '2', '2019-08-29', '東京都文京区目白台2-9-4-302', '070-4043-4684', 'マクドナルド青山店', '03-3423-0710', '東京都港区北青山3-3-7', '原宿駅', NULL, 19552751, NULL, '0.91027300 1550197534.jpg', '第1学年', NULL, '留学', '2019-02-15 08:25:34', '2019-03-09 11:29:31'), (52, 'KHADKA', 'SAMJIB', 'カドカ ', 'サンジバ', 1, '19176', 'PN84798921EA', 'm', 1, '1995-08-26', '2019-04-02', '2020-03-31', '2', '2019-08-17', '東京都豊島区南大塚1-30-13コーポ武幸301', '080-2389-7861', NULL, NULL, NULL, NULL, NULL, 19598652, NULL, '0.69812900 1550197663.jpg', '第1学年', NULL, '留学', '2019-02-15 08:27:43', '2019-03-09 11:29:47'), (53, 'GURUNG', 'AMBAR BAHADUR', 'グルン', 'アンバル バハドル', 1, '19111', 'PN66933652EA', 'm', 1, '1995-11-18', '2019-04-02', '2020-03-31', '2', '2019-07-23', '東京都新宿区北新宿3-18-12 メゾンT・O 101号室', '080-6256-4366', NULL, NULL, NULL, NULL, NULL, 19769753, NULL, '0.14793100 1550198164.jpg', '第1学年', NULL, '留学', '2019-02-15 08:36:04', '2019-03-09 10:50:10'), (54, 'GIRI', 'RAJU', 'ギリ', ' ラジュ', 1, '19148', 'PN13151191EA', 'm', 1, '1991-04-30', '2019-04-02', '2020-03-31', '2', '2019-07-13', '東京都豊島区池袋3-37-7 太考荘201号室', '070-1069-3947', NULL, NULL, NULL, NULL, NULL, 19852254, NULL, '0.79790400 1550198448.jpg', '第1学年', NULL, '留学', '2019-02-15 08:40:48', '2019-03-09 11:11:15'), (55, 'GURUNG', 'MANISHA', 'グルング', 'マニシャ', 1, '19149', 'PN64370869EA', 'f', 1, '1993-12-24', '2019-04-02', '2020-03-31', '1', '2019-04-12', '東京都台東区浅草橋4-6-1 建部ビル2FE', '080-5037-1452', 'ワールドエンタプライズ株式会社', '044-281-1935', '神奈川県川崎市川崎区殿町3-26- 1', '川島新田駅', NULL, 19727955, 1, '0.81904700 1550198645.jpg', '第1学年', NULL, '留学', '2019-02-15 08:44:05', '2019-03-09 11:12:36'), (56, 'LAMA', 'KIRAN', 'ラマ', 'キラン', 1, '19150', 'EG47988570EA', 'm', 1, '1994-06-29', '2019-04-02', '2020-03-31', '4', '2019-07-28', '東京都上池袋1-17-5', '080-3963-5404', NULL, NULL, NULL, NULL, NULL, 19667356, NULL, '0.69707100 1550198802.jpg', '第1学年', NULL, '留学', '2019-02-15 08:46:42', '2019-03-09 11:12:52'), (57, 'OLI', 'PABAN', 'オリ', 'パバン', 1, '19112', 'PN95076094EA', 'm', 1, '1991-07-31', '2019-04-02', '2020-03-31', '2', '2019-08-10', '東京都新宿区大久保1-12-21 第8コート新宿205号室', '080-1383-7778', '神奈川ベース店 ヤマト運輸㈱', '045-500-5149', '神奈川県横浜市鶴見区安善町1-1-1 ', '安善町駅', NULL, 19897357, NULL, '0.03926500 1550198968.jpg', '第1学年', NULL, '留学', '2019-02-15 08:49:28', '2019-03-09 10:51:48'), (58, 'MAXAMMATIBROXIMOV', 'AZIZBEK', 'マハマディロヒモフ ', 'アズズベク', 1, '19151', 'EG66510901FA', 'm', 3, '1992-04-17', '2019-04-02', '2020-03-31', '5', '2019-03-26', '東京都北区滝野川3-51-6 レオパレスルミエール206号室', '070-4466-3553', 'SGフィルダー㈱ 城南営業所', '03-3799-8691', '東京都品川区八潮3-2-38', '品川駅', NULL, 19225558, NULL, '0.91425900 1550199003.jpg', '第1学年', NULL, '留学', '2019-02-15 08:50:03', '2019-03-09 11:13:07'), (59, 'ACHARYA', 'SHILA', 'アチャリャ', ' シラ', 1, '19152', 'PN22832871EA', 'f', 1, '1986-07-04', '2019-04-02', '2020-03-31', '1', '2019-04-04', '東京都新宿区高田馬場4-28-13 Y.Oマンション402号室', '090-6155-9078', NULL, NULL, NULL, NULL, NULL, 19258859, 1, '0.99707800 1550199168.jpg', '第1学年', NULL, '留学', '2019-02-15 08:52:48', '2019-03-09 11:13:21'), (60, 'CHHANTYAL', 'NISHA', 'チャンタル', ' ニシャ', 1, '19153', 'PN30058932EA', 'f', 1, '1998-08-03', '2019-04-02', '2020-03-31', '1', '2019-05-23', '東京都板橋区舟渡3-13-15 レオパレスリベール404号室', '080-5898-7261', 'マクドナルド青山店', '03-3423-0710', '東京都港区北青山3-3-7', '表参道駅', NULL, 19390860, 1, '0.83102500 1550199486.jpg', '第1学年', NULL, '留学', '2019-02-15 08:58:06', '2019-03-09 11:13:34'), (61, 'BHUSAL', 'BISHNU PRASAD', 'ブザル', 'ビスヌ プラサド', 1, '19113', 'PN80963429EA', 'm', 1, '1991-08-03', '2019-04-02', '2020-03-31', '2', '2019-07-24', '東京都新宿区新宿7-6-13 東山荘401号室', '080-9395-0498', NULL, NULL, NULL, NULL, NULL, 19943661, NULL, 'bccc3e8fea2381665b50754ccc764506.1552107345.jpg', '第1学年', NULL, '留学', '2019-02-15 08:59:29', '2019-03-09 10:55:45'), (62, 'SHERPA', 'LAKPADIKI', 'シェルパ', 'ラクパディキ', 1, '19114', 'PN48280672EA', 'f', 1, '1993-04-15', '2019-04-02', '2020-03-31', '1', '2019-04-15', '東京都板橋区舟渡3-13-15 レオパレスリベール404号室', '090-4419-8289', 'マクドナルド西荻窪店', '03-3395-7076', '東京都杉並区西荻南3-24-1', NULL, NULL, 19237562, 1, '0.12917500 1550201053.jpg', '第1学年', NULL, '留学', '2019-02-15 09:24:13', '2019-03-09 10:56:58'), (63, 'TAMANG', 'TARA', 'タマン', 'タラ', 1, '19115', 'PN80807434EA', 'f', 1, '1997-06-10', '2019-04-02', '2020-03-31', '1', '2019-04-26', '埼玉県戸田市大字新曽956番地 フジレジデンスⅡ 102号室', '080-9397-9249', 'ファミリーマート 板橋舟渡二丁目店', '03-5916-9171', '東京都板橋区舟渡二丁目21番2', '浮間舟渡駅', NULL, 19578163, 1, '0.91259200 1550206381.jpg', '第1学年', NULL, '留学', '2019-02-15 10:53:01', '2019-03-09 10:57:13'), (64, 'POUDEL', 'SHIVA', 'パウデル', 'シバ', 1, '19116', 'PN73438574EA', 'm', 1, '1997-02-14', '2019-04-02', '2020-03-31', '2', '2019-08-14', '東京都板橋区富士見町20-32', '080-1391-4495', NULL, NULL, NULL, NULL, NULL, 19484964, NULL, '0.80399900 1550206956.jpg', '第1学年', NULL, '留学', '2019-02-15 11:02:36', '2019-03-09 10:57:33'), (65, 'RAI', 'NIKHIL', 'ライ', '二キル', 1, '19117', 'PN25458155EB', 'm', 1, '1996-01-23', '2019-04-02', '2020-03-31', '1', '2019-04-03', '栃木県宇都宮市南大通り1-1-12 宇都宮ダイカンプラザスポーツメント404号室', '070-3529-7149', 'ハイボール酒場 宇都宮駅西口店', '028-678-4744', '栃木県宇都宮市大通り3-1-2', '宇都宮駅', NULL, 19551965, 1, '0.91586700 1550207971.jpg', '第1学年', NULL, '留学', '2019-02-15 11:19:31', '2019-03-09 10:57:47'), (66, 'PURI', 'MABIN', 'プリ', 'マビン', 1, '19118', 'PN04238464EB', 'm', 1, '1994-05-10', '2019-04-02', '2020-03-31', '1', '2019-04-03', '栃木県宇都宮市南大通り1-1-12 宇都宮ダイカンプラザスポーツメント404号室', '090-8056-0853', 'ハイボール酒場 宇都宮駅西口店', '028-678-4744', '栃木県宇都宮市大通り3-1-2', '宇都宮駅', NULL, 19418766, 1, '0.11338000 1550208255.jpg', '第1学年', NULL, '留学', '2019-02-15 11:24:15', '2019-03-09 10:58:01'), (67, 'SHRESTHA', 'SUSHANT', 'シレスタ', 'スサント', 1, '19119', 'PN68058166EB', 'm', 1, '1996-11-27', '2019-04-02', '2020-03-31', '1', '2019-04-03', '栃木県宇都宮市南大通り1-1-12 宇都宮ダイカンプラザスポーツメント404号室', '090-8052-8866', '東洋ビューティ', '028-687-2250', '栃木県芳賀郡芳賀町芳賀台38-5', '宇都宮駅', NULL, 19326567, 1, '0.89650900 1550209485.jpg', '第1学年', NULL, '留学', '2019-02-15 11:44:45', '2019-03-09 10:58:18'), (68, 'BHATTARAI', 'PUJA', 'バトライ', 'プザ', 1, '19120', 'PN46652724EA', 'f', 1, '1996-08-07', '2019-04-02', '2020-03-31', '2', '2019-07-26', '東京都新宿区百人町2-21-11 シエスタ永和Ⅰ 103号室', '080-5047-2085', NULL, NULL, NULL, NULL, NULL, 19611068, NULL, '0.09798000 1550210874.jpg', '第1学年', NULL, '留学', '2019-02-15 12:07:54', '2019-03-09 10:58:35'), (69, 'PARAJULI BHAT', 'BHUPENDRA', 'パラジュリ バット', 'ブペンドラ', 1, '19121', 'EG42723700RD', 'm', 1, '1996-05-07', '2019-04-02', '2020-03-31', '6', '2019-08-11', '山口県萩市大字椿東3000-10 専門学校さくら国際言語学院寮', '080-2755-1926', 'フジミツ株式会社', '0837-22-3354', '山口県長門市三隅下2378-31', '長門市三隅駅', NULL, 19570769, NULL, '0.45894900 1550212621.jpg', '第1学年', NULL, '留学', '2019-02-15 12:37:01', '2019-03-09 10:58:56'), (70, 'PAUDEL', 'BHOLARAJ', 'ポウデル', 'ボララズ', 1, '19122', 'EG83158091RD', 'm', 1, '1994-12-09', '2019-04-02', '2020-03-31', '6', '2019-08-14', '山口県萩市大字椿東3000-10 専門学校さくら国際言語学院寮', '080-2884-8464', 'デリカサラダボーイ㈱山口', '083-974-3900', '山口県山口市小郡上郷5262', '上郷駅', NULL, 19406470, NULL, '0.20070100 1550213048.jpg', '第1学年', NULL, '留学', '2019-02-15 12:44:08', '2019-03-09 10:59:12'), (71, 'ACHARYA NEUPANE', 'URMILA', 'アチャリャ ネウパネ', 'ウルミラ', 1, '19123', 'EG27924025GA', 'f', 1, '1993-04-07', '2019-04-02', '2020-03-31', '5', '2019-01-15', '東京都杉並区天沼1-1-14 ゆたか荘', '080-5198-4845', 'TOKYO CRAFT LAND 銀座', '03-6263-8715', '東京都中央区銀座5-4-1 西五ビルB1', '銀座駅', NULL, 19182771, 1, '0.10165700 1550214883.jpg', '第1学年', NULL, '留学', '2019-02-15 13:14:43', '2019-03-09 10:59:37'), (72, 'SIMKHADA', 'SITTAL', 'シマカダ', 'シタル', 1, '19124', 'PN35179549EA', 'm', 1, '1991-03-02', '2019-04-02', '2020-03-31', '2', '2019-04-09', '東京都新宿区百人町2-18-9 グリーンハイツ202号室', '080-6722-4885', NULL, NULL, NULL, NULL, NULL, 19206872, NULL, '0.10329300 1550221264.jpg', '第1学年', NULL, '留学', '2019-02-15 15:01:04', '2019-03-09 10:59:50'), (73, 'TIWARI PANDAY', 'SARITA', 'ティワリ パンダイ', 'サリタ', 1, '19125', 'EG87373685GA', 'f', 1, '1992-11-28', '2019-04-02', '2020-03-31', '4', '2019-12-10', '東京都新宿区高田馬場3-25-21 昇峰ハイム2 103号室', '080-5680-7202', 'マクドナルド第一京浜鮫洲店', '03-5783-3312', '東京都品川区東大井1-2-20', '鮫洲駅', NULL, 19153773, NULL, '0.53115800 1550221642.jpg', '第1学年', NULL, '留学', '2019-02-15 15:07:22', '2019-03-09 11:00:05'), (74, 'ADHIKARI HUMAGAIN', 'YAMUNA', 'アディカリ フマガイン', 'ヤムナ', 1, '19126', 'PN01029888FA', 'f', 1, '1993-03-17', '2019-04-02', '2020-03-31', '4', '2020-01-04', '東京都新宿区高田馬場3-25-21 昇峰ハイム2 103号室', '090-9333-6285', 'マクドナルド恵比寿駅前店', '03-3444-0761', '東京都渋谷区恵比寿1-10-10', 'JR恵比寿駅', NULL, 19175174, NULL, '0.23834700 1550222473.jpg', '第1学年', NULL, '留学', '2019-02-15 15:21:13', '2019-03-09 11:00:30'), (75, 'ZHAO', 'CHU LEI', 'チョウ', 'ソレイ', 1, '19127', 'EG86078049FA', 'm', 5, '1999-03-07', '2019-04-02', '2020-03-31', '5', '2019-01-06', '東京都文京区大塚5-7-11-603号室', '080-3093-5070', 'していない', NULL, NULL, NULL, NULL, 19489975, NULL, '0.40832600 1550224892.jpg', '第1学年', NULL, '留学', '2019-02-15 16:01:32', '2019-03-09 11:01:02'), (76, 'SHRESTHA', 'ARCHANA', 'スレスタ', 'アルツアナ', 1, '19128', 'PN57792482QG', 'f', 1, '1995-08-19', '2019-04-02', '2020-03-31', '4', '2019-07-13', '山口県萩市大字椿東3000-10 専門学校さくら国際言語学院寮', '080-2944-3868', 'セブン‐イレブン 萩古萩町店', '0838-22-0225', '山口県萩市大字古萩町25-5', '東萩駅', NULL, 19898076, NULL, '0.90177100 1550225530.jpg', '第1学年', NULL, '留学', '2019-02-15 16:12:10', '2019-03-09 11:01:24'), (77, 'GURUNG', 'SACHIN', 'グルン', 'サチン', 1, '19129', 'EG80537358RD', 'm', 1, '1992-11-28', '2019-04-02', '2020-03-31', '6', '2019-08-14', '山口県萩市大字椿東3000-10 専門学校さくら国際言語学院寮', '080-2946-4640', 'デリカサラダボーイ㈱山口', '083-974-3900', '山口県山口市小郡上郷5262', '上郷駅', NULL, 19188877, NULL, '0.34254900 1550225844.jpg', '第1学年', NULL, '留学', '2019-02-15 16:17:24', '2019-03-09 11:01:39'), (78, 'BHANDARI ', 'BIBEK', 'バンダリ ', 'ビベク', 2, '18124', 'PN00321050EA', 'm', 1, '1992-04-05', '2018-04-06', '2020-03-31', '4', '2020-05-25', '東京都中野区上高田3丁目18番6号薬師パレスマンション501', '080-6489-9658', 'ローソン中野セントラルパークイースト', '03-3387-3930', '東京都中野区中野4-10-1', '中野', NULL, 18984078, 1, '422d33c37a71d5ecb3b73ad3a638c23a.1551011302.jpg', '第2学年', NULL, '留学', '2019-02-20 13:42:13', '2019-02-26 14:35:45'), (79, 'RAI ', 'SUNIL', 'ライ ', 'スニル', 2, '18125', 'PN55441866EA', 'm', 1, '1997-06-23', '2018-04-06', '2020-03-31', '2', '2019-06-11', '東京都中野区上高田3丁目18番6号薬師パレスマンション501', '080-6489-2351', NULL, NULL, NULL, NULL, NULL, 18237879, 1, '8f160d4c9a06a60e675752cf951aea49.1551011496.jpg', '第2学年', NULL, '留学', '2019-02-20 13:45:20', '2019-02-26 14:36:26'), (80, 'GAHATRAJ ', 'KANTA', 'ガハタラズ ', 'カンタ', 2, '18126', 'PN86201286EF', 'f', 1, '1993-08-06', '2018-04-06', '2020-03-31', '2', '2019-08-14', '東京都杉並区阿佐谷北2丁目6番15号エーデルワイス201', '080-5384-5862', '(株)ケー・エキスプレス(レストラン)つるとんたん羽田店', '03-6428-0326', '東京都大田区羽田空港2-6-5国際線ターミナル4F', '羽田空港国際ターミナル', NULL, 18365980, 1, 'd64c372150c3eb9ae10fc0abedefe040.1551011527.jpg', '第2学年', NULL, '留学', '2019-02-20 13:49:36', '2019-02-26 14:36:41'), (81, 'GOTAME ', 'ISHWOR', 'ゴタメ ', 'イソル', 2, '18127', 'PN12185215EA', 'm', 1, '1997-11-10', '2018-04-06', '2020-03-31', '4', '2020-07-13', '東京都北区赤羽北2丁目19番6-204号 メゾン・ド•プラネット', '090-9381-1484', 'ヤマト運輸株式会社', '045-500-5149', '神奈川県横浜市鶴見区安善町1-1-1', '浅野・安善', NULL, 18568281, 1, 'b2852e6de10522d6fae03c4e55c30cae.1551011556.jpg', '第2学年', NULL, '留学', '2019-02-20 13:52:36', '2019-02-26 14:36:54'), (82, 'PHAM THI  ', 'THUY LINH', 'ファン ティ ', 'トゥイ リン', 2, '18128', 'PN14224873EF', 'f', 4, '1997-04-22', '2018-04-06', '2020-03-31', '4', '2020-07-19', '東京都新宿区下落合1-2-13 フェリスロータス102', '070-2159-4873', '海と', '03-5954-2620', '東京都豊島区高田3-13-6', '高田馬場', NULL, 18356782, 1, 'b850896432e2d4c9ac6983e01d3d9fc0.1551011633.jpg', '第2学年', NULL, '留学', '2019-02-20 13:55:23', '2019-02-26 14:37:08'), (83, 'BUDHATHOKI', 'SAMJHANA', 'ブダトキ ', 'サムザナ', 2, '18129', 'PN42301209EA', 'f', 1, '1988-04-23', '2018-04-06', '2020-03-31', '2', '2019-04-03', '東京都新宿区北新宿3-5-25 レオーベンハイム201', '070-1045-7799', 'ヤマト運輸神奈川主管', '045-500-5149', '神奈川県横浜市鶴見区安善町1-1-1', '浅野・安善', NULL, 18985083, 1, '3a67bdf1aee9be564d30c4518096c541.1551011672.jpg', '第2学年', NULL, '留学', '2019-02-20 13:58:21', '2019-02-26 14:37:20'), (84, 'LAMICHHANE', 'GOVINDA PRASAD', 'ラミチャネ ', 'ゴビンダ パラサド', 2, '18136', 'PN18365445EA', 'm', 1, '1978-05-18', '2018-04-06', '2020-03-31', '4', '2020-07-02', '東京都新宿区百人町2丁目20番20号アーバンリーベ103', '070-1949-0264', '日本マクドナルド(株)東新宿駅前店', '03-5291-8235', '東京都新宿区新宿6-29-10', '東新宿', NULL, 18484084, 1, '2c72b3f77c41dda9f57d5abdd8bace96.1551011742.jpg', '第2学年', NULL, '留学', '2019-02-20 14:06:12', '2019-02-26 14:38:32'), (85, 'DO THI ', 'TUYET NHUNG', 'ド ティ ', 'テゥエット ニュン', 2, '18139', 'EG13526252EF', 'f', 4, '1993-12-14', '2018-04-06', '2020-03-31', '2', '2018-09-19', '東京都新宿区北新宿2-6-5 ハイツ柏木102', '080-6898-9294', 'ローソン', '03-6212-8012', '東京都千代田区丸の内2-6-1', '東京', NULL, 18866685, 1, '183b88cb799478a3327a7ca5f216f247.1551011771.jpg', '第2学年', NULL, '留学', '2019-02-20 14:10:04', '2019-02-26 14:39:22'), (86, 'DONG ', 'VAN DAI', 'ドン ', 'ヴァン ダイ', 2, '18140', 'PN27825039EF', 'm', 4, '1993-08-20', '2028-04-06', '2020-03-31', '4', '2020-05-01', '東京都新宿区下落合1-2-13 フェリスロータス102', '070-2159-4474', 'ファミリーマート', '03-3524-8224', '東京都中央区築地6-4-10', NULL, NULL, 18825486, 1, '308f2ed65f9fe9c2f71ba8485501594b.1551011796.jpg', '第2学年', NULL, '留学', '2019-02-20 14:13:26', '2019-02-26 14:39:57'), (87, 'KHAREL BHUMI PRASAD', 'BHUMI PRASAD', 'カーレル ', 'ブミ プラサド', 2, '18141', 'PN49823572EA', 'm', 1, '1986-05-29', '2018-04-06', '2020-03-31', '2', '2019-07-09', '東京都新宿区百人町1丁目9番8号 アーバンフジ101', '080-9107-6929', 'セブンイレブン', '03-3470-7119', '東京都港区六本木6-1-3', '六本木', NULL, 18330987, 1, '22bd752862bf6192824e919a25ad1f1a.1551011825.jpg', '第2学年', NULL, '留学', '2019-02-20 14:15:52', '2019-02-26 14:40:45'), (88, 'TAMANG', 'PREM KUMAR', 'タマング ', 'ペレム クマル', 2, '18142', 'PN47875737EA', 'm', 1, '1989-11-27', '2018-04-06', '2020-03-31', '2', '2019-07-23', '東京都新宿区北新宿1丁目35番14号東新マンション303', '070-4734-1405', '金の蔵 新宿ペレット店', '03-5909-5650', '東京都新宿区西新宿1−1−1パレットビル6F', '新宿・新宿西口', NULL, 18651288, 1, 'b3ed3719e497368cc85014920c31671e.1551011850.jpg', '第2学年', NULL, '留学', '2019-02-20 14:18:15', '2019-02-26 14:41:22'), (89, 'MAHATO', 'RAJESH KUMAR', 'マハト ', 'ラゼス クマル', 2, '18143', 'PN17840330EF', 'm', 1, '1992-02-29', '2018-04-06', '2020-03-31', '4', '2020-08-17', '東京都豊島区西巣鴨1丁目3番19号ホワイトハイツ大塚学生寮別棟101号', '070-3544-1631', 'ヤマト運輸株式会社', '0120-555-643', '東京都大田区羽田旭町11-1', '整備場', NULL, 18132489, 1, '5b6e29aede942ed7ca43c3bc1a51f1bc.1551011875.jpg', '第2学年', NULL, '留学', '2019-02-20 14:20:39', '2019-02-26 14:42:00'), (90, 'KANDEL PAUDEL ', 'PARBATI', 'カンデル パウデル ', 'パルバティ', 2, '18144', 'PN44132791EA', 'f', 1, '1991-11-24', '2018-04-06', '2020-03-31', '2', '2019-08-22', '東京都中野区東中野1丁目46番21号パーシモン東中野101', '070-3620-0462', '(株)武蔵野フーズ ムサシノ食品部所沢工場', '049-259-5228', '埼玉県入間郡三芳町竹間沢東15-7', '柳瀬川・新座', NULL, 18257490, 1, '0441a7195440425d5f4b0a976e4c38bf.1551011903.jpg', '第2学年', NULL, '留学', '2019-02-20 14:22:52', '2019-02-26 14:43:01'), (91, 'LAMA', 'NABINA', 'ラマ ', 'ナビナ', 2, '18145', 'PN99671229ED', 'f', 1, '1993-08-02', '2018-04-06', '2020-03-31', '1', '2019-04-25', '埼玉県和光市白子1丁目24番6号小泉荘', '090-4412-7218', 'ローソン', '03-5948-5290', '東京都北区上十条2-30-1', '十条', NULL, 18126091, 1, '02108759409ddc6b592ec9f49e69cfc9.1551011955.jpg', '第2学年', NULL, '留学', '2019-02-20 14:26:30', '2019-02-26 14:43:36'), (92, 'MAGAR', 'MILAN', 'マガル ', 'ミラン', 2, '18146', 'PN92542835EA', 'm', 1, '1995-05-07', '2018-04-06', '2020-03-31', '2', '2019-03-28', '東京都新宿区下落合4丁目9番1号プチハイツY・T104', '070-3848-3160', 'ローソン港一の橋店', '03-5442-0397', '東京都港区麻布十番4-3-1', '麻布十番', NULL, 18744292, 1, 'f700cee972ac962b4e8178f1e5027fa0.1551011982.jpg', '第2学年', NULL, '留学', '2019-02-20 14:29:41', '2019-02-26 14:44:14'), (93, 'POUDEL ', 'SABIN', 'ポウデル ', 'サビン', 2, '18147', 'PN97952435EA', 'm', 1, '1995-10-23', '2018-04-06', '2020-03-31', '2', '2019-05-09', '東京都新宿区大久保2丁目33番3号ロッソ新大久保C棟103', '070-4347-0990', 'ファミリマート 恵比寿二丁目店', '03-6408-5010', '東京都渋谷区恵比寿2-29-2', '恵比寿・白金高輪', NULL, 18783293, 1, '6eee5dbcb00012325e3ee0c80388ad8b.1551012008.jpg', '第2学年', NULL, '留学', '2019-02-20 14:32:36', '2019-02-26 14:44:46'), (94, 'GURUNG ', 'SONIKA ', 'グルン ', 'ソニカ', 2, '18148', 'PN90165317EA', 'f', 1, '1985-10-14', '2018-04-06', '2020-03-31', '2', '2019-05-10', '東京都中野区東中野2-34-2 桜山ハウス102', '070-3996-0834', 'ワールドエンタプライズ(株)', '044-281-1935', '神奈川県川崎市川崎区殿町3-26-1', '小鳥新田', NULL, 18804694, 1, '9f0eb1170f6e3373b1aad8fd8183dc33.1551012030.jpg', '第2学年', NULL, '留学', '2019-02-20 14:34:50', '2019-02-26 14:45:21'), (95, 'TANDUKAR ', 'SANGITA', 'タンデュカル ', 'サンギタ', 2, '18149', 'PN82426980EF', 'f', 1, '1992-07-07', '2018-04-06', '2020-03-31', '4', '2020-08-27', '東京都豊島区長崎2丁目11番10号椎名町マンションH号', '070-3548-0833', '日本マクドナルド(株)西武新宿駅前店', '03-6273-8101', '東京都新宿区歌舞伎町1-24-1', '西武新宿', NULL, 18879595, 1, '06cf692946bc2728b0da1ad61e87161c.1551012085.jpg', '第2学年', NULL, '留学', '2019-02-20 14:37:12', '2019-02-26 14:45:57'), (96, 'SAPKOTA ', 'KALPANA', 'サプコタ ', 'カルパナ', 2, '18150', 'PN10690284EF', 'f', 1, '1994-11-24', '2018-04-06', '2020-03-31', '4', '2020-09-27', '東京都板橋区板橋4丁目11番10-107号イシイビル', '070-3620-0550', 'ヤマト運輸神奈川ベース店', '045-500-5149', '神奈川県横浜市鶴見区安善町1-1-1', '浅野・安善', NULL, 18385096, 1, 'e5bc5f3836c3faacfa44f53c47e206d0.1551012127.jpg', '第2学年', NULL, '留学', '2019-02-20 14:40:40', '2019-02-26 14:46:30'), (97, 'SINGH', 'GYANENDRA PRASAD', 'シン ', 'ギャネンドラ プラサド', 2, '18152', 'PN94576629EA', 'm', 1, '1990-02-01', '2018-04-06', '2020-03-31', '4', '2020-05-14', '東京都上落合1丁目9番15号福室ビル303', '080-6764-8194', 'ヤマト運輸神奈川ベース店', '045-751-3729', '神奈川県横浜市鶴見区安善町1-1-1', '浅野・安善', NULL, 18186797, 1, '8e248e1bad774b19bb03b1bc60ebc57e.1551012224.jpg', '第2学年', NULL, '留学', '2019-02-20 14:46:03', '2019-02-26 14:49:05'), (98, 'PAUDYAL ', 'GOPI PRASAD', 'パウデル ', 'ゴピ プラサド', 2, '18153', 'PN96824373EA', 'm', 1, '1986-04-15', '2018-04-06', '2020-03-31', '2', '2019-05-14', '東京都豊島区池袋4丁目30番9号ハイツ新井201号', '080-6250-4664', 'S・TEC株式会社', '03-3235-9888', '東京都新宿区岩戸町14番地 神楽坂不二ビル2-D', '牛込神楽坂', NULL, 18555698, 1, '544d4001986956872063dd1c2e77396a.1551012256.jpg', '第2学年', NULL, '留学', '2019-02-20 14:48:41', '2019-02-26 14:49:59'), (99, 'DAHAL ', 'BIDUR', 'ダハル ', 'ビズラ', 2, '18154', 'PN76322241EA', 'm', 1, '1994-04-20', '2018-04-06', '2020-03-31', '2', '2019-06-21', '東京都板橋区板橋4丁目11番10-107号イシイビル', '080-6765-2984', 'ヤマト運輸神奈川ベース店', '045-500-5149', '神奈川県横浜市鶴見区安善町1-1-1', '浅野・安善', NULL, 18912199, 1, '564141d46e4a369a6460979d4e936217.1551012294.jpg', '第2学年', NULL, '留学', '2019-02-20 14:51:10', '2019-02-26 14:50:45'), (100, 'GHIMIRE', 'APSARA', 'ギミレ ', 'アプサラ', 2, '18155', 'PN78755846EA', 'f', 1, '1990-05-02', '2018-04-06', '2020-03-31', '2', '2019-09-11', '東京都新宿区高田馬場2丁目6番10号関ビル406A', '070-3546-3203', '株式会社カスタマーディライト', '03-5925-8258', '東京都新宿区新宿2-8-5', '新宿三丁目・新宿御苑前', NULL, 188900100, 1, '1364d994de76d170c34e742f23a87a15.1551012340.jpg', '第2学年', NULL, '留学', '2019-02-20 14:53:28', '2019-02-26 14:53:24'), (101, 'MAGAR ', 'AMBIKA', 'マガル ', 'アンビカ', 2, '18156', 'PN91731940EA', 'f', 1, '1991-12-08', '2018-04-06', '2020-03-31', '2', '2019-03-28', '東京都杉並区天沼1-15-8 サニーハイツ101', '070-3848-3185', 'ねぎし フードサービス', '03-6908-5306', '東京都中野区東中野1-11-10エヌアンドエフビル4F', '中野坂上・東中野', NULL, 186124101, 1, 'b13c5d263d8b1553cd290970a8d7abae.1551012367.jpg', '第2学年', NULL, '留学', '2019-02-20 14:55:54', '2019-02-26 14:54:18'), (102, 'DARLAMI', 'BISHESH KUMAR', 'ダラミ ', 'ビセス クマル', 2, '18159', 'PN75871944EA', 'm', 1, '1990-06-29', '2018-04-06', '2020-03-31', '4', '2020-05-25', '東京都北区田端1丁目10番9号パシフィックハイツ102号', '070-1499-8587', 'ヤマト運輸神奈川ベース店', '045-500-5149', '神奈川県横浜市鶴見区安善町1-1-1', '浅野・安善', NULL, 186894102, 1, '70bfd6003ea9ddc40ac0f3debe2d33f8.1551012399.jpg', '第2学年', NULL, '留学', '2019-02-20 14:59:17', '2019-02-26 14:55:53'), (103, 'BHATTARAI ', 'NIROSH', 'バタライ ', 'ニロス', 2, '18160', 'PN09046309EA', 'm', 1, '1993-04-17', '2018-04-06', '2020-03-31', '2', '2019-04-25', '東京都豊島区南池袋1丁目5番2号 井上荘101号', '090-9317-3259', NULL, NULL, NULL, NULL, NULL, 187080103, 1, '2696285675f2afebf5db0e67702d9ccd.1551012432.jpg', '第2学年', NULL, '留学', '2019-02-20 15:02:27', '2019-02-26 14:57:04'), (104, 'LU', 'YU TING', 'リク ', 'ギョクテイ', 2, '18161', 'PN54874673EA', 'f', 4, '1994-11-11', '2018-04-06', '2020-03-31', '4', '2020-08-17', '東京都豊島区池袋3丁目56番8号グリーンヴィレッジ402号', '070-3662-1091', 'セブンイレブン港区三田3丁目店', '03-3798-5033', '東京都港区三田3-7-15', '田町', NULL, 183757104, 1, 'eaf338fcba9f72228df6a33978e51753.1551012465.jpg', '第2学年', NULL, '留学', '2019-02-20 15:04:52', '2019-02-26 14:58:00'), (105, 'TAMANG GOLE SITA', 'SITA', 'タマン ゴレ ', 'シタ', 2, '18162', 'PN00177019EA', 'f', 1, '1994-09-21', '2018-04-06', '2020-03-31', '4', '2020-04-13', '埼玉県和光市白子1丁目24番6号小泉荘', '080-5042-4556', '株式会社武蔵野朝霞工場', '048-469-1500', '埼玉県朝霞市膝折町4−14−30', '成増・地下鉄成増', NULL, 189253105, 1, '9774b843cc6a7d6c95ee117c65f77b51.1551012506.jpg', '第2学年', NULL, '留学', '2019-02-20 15:08:22', '2019-02-26 14:58:48'), (106, 'BAJAGAIN ', 'RAVI', 'バジャガイン ', 'ラビ', 2, '18163', 'PN47963647EF', 'm', 1, '1990-08-25', '2018-04-06', '2020-03-31', '4', '2020-10-26', '東京都豊島区池袋3丁目52番15号メゾン山藤302号', '070-4125-0402', 'ヤマト運輸株式会社', '0120-555-643', '東京都大田区羽田旭町11-1', '整備場', NULL, 182164106, 1, '97a70a41ebbc5c29683bd797cb02c07a.1551012555.jpg', '第2学年', NULL, '留学', '2019-02-20 15:12:16', '2019-02-26 14:59:26'), (107, 'WANG ', 'WEIKAI', 'オウ ', 'イカイ', 2, '18166', 'PN05523676EA', 'm', 5, '1996-10-14', '2018-04-06', '2020-03-31', '2', '2019-08-17', '東京都中野区鷺宮4丁目37番16号トラスティ鷺宮211', '070-3618-8999', '餃子の店 ニイハオ', '03-3465-0747', '東京都渋谷区西原2-27-4', '幡ヶ谷', NULL, 185166107, 1, '35e657837d630c72a2c8d40341942a18.1551012611.jpg', '第2学年', NULL, '留学', '2019-02-20 15:15:53', '2019-02-26 15:02:48'), (108, 'RAI ', 'SUSHMANJALI', 'ライ ', 'ススマンザリ', 2, '18167', 'PN75688357EA', 'f', 1, '1994-08-25', '2018-04-06', '2020-03-31', '4', '2020-07-27', '東京都豊島区上池袋1丁目16番11号カーサ・ブランカ202号', '080-3471-0407', 'マクドナルド高田馬場駅前店', '03-5292-9431', '東京都新宿区高田馬場2-18-11稲門ビル2F', '高田馬場', NULL, 189521108, 1, '802b4a3594a12f9de7842b0e57ff330a.1551012648.jpg', '第2学年', NULL, '留学', '2019-02-20 15:20:06', '2019-02-26 15:03:20'), (109, 'TAMANG', 'BIJAY', 'タマング ', 'ビザヤ', 2, '18168', 'PN96085234EF', 'm', 1, '1989-07-18', '2018-04-06', '2020-03-31', '4', '2020-11-01', '東京都豊島区池袋3丁目52番15号メゾン山藤302号', '070-1065-9527', '株式会社ゴールデンマジック', '03-3272-8071', '東京都中央区八重洲1-5-10RISM八重洲B1〜2F', '丸山 侑也', NULL, 181533109, 1, 'fa6c9d02ba7042d30bcfc8b9f7a42c30.1551012741.jpg', '第2学年', NULL, '留学', '2019-02-20 15:23:00', '2019-02-26 15:04:14'), (110, 'KANDEL', 'NAV RAJ', 'カンデル ', 'ナブラズ', 2, '18170', 'PN02095551EA', 'm', 1, '1993-02-16', '2018-04-06', '2020-03-31', '4', '2020-05-14', '東京都新宿区百人町2丁目20番20号アーバンリーベ103', '070-1944-5123', 'マクドナルドJR東京駅店', '03-3211-3677', '東京都千代田区丸の内1-9-1東京駅一番街', '東京', NULL, 189859110, 1, '638cd1bcc8a1a77b7253a39a71ec1451.1551012807.jpg', '第2学年', NULL, '留学', '2019-02-20 15:26:02', '2019-02-26 15:05:06'), (111, 'CHHETRI', 'SITA', 'チェトリ ', 'シタ', 2, '18171', 'PN79254571EA', 'f', 1, '1992-07-14', '2018-04-06', '2020-03-31', '4', '2020-04-13', '東京都新宿区北新宿1丁目27番4号 パークリッヂハイツ205', '080-5046-4132', '(株)日本レストランエンタプライズ', '048-422-2881', '埼玉県戸田市美女木1269-17', '北戸田', NULL, 188966111, 1, 'c8e3c2b2f0ba04b9a9ad17a0f44273a0.1551012835.jpg', '第2学年', NULL, '留学', '2019-02-20 15:28:32', '2019-02-26 15:05:43'), (112, 'K C', 'NIRMALA', 'ケーシー ', 'ニルマラ', 2, '18172', 'PN86901111EA', 'f', 1, '1993-04-14', '2018-04-06', '2020-03-31', '4', '2020-04-12', '東京都豊島区西巣鴨2丁目8番8号 阿部方', '080-5186-5468', '株式会社きむら家', '03-5368-0337', '東京都新宿区住吉町6-3', '曙橋', NULL, 189618112, 1, 'c82b74583f5ffdb3721e8379f919f579.1551012859.jpg', '第2学年', NULL, '留学', '2019-02-20 15:31:33', '2019-02-26 15:06:20'), (113, 'SHRESTHA', 'BISHWASH', 'シュレスタ ', 'ビシュワシュ', 2, '18173', 'PN82381595EA', 'm', 1, '1992-05-01', '2018-04-06', '2020-03-31', '2', '2019-05-16', '東京都新宿区百人町1-17-5-402号', '080-8860-6526', '東栄フーズ株式会社', '03-3298-1121', '東京都品川区東大井3-17-4プリメール', '立会川・大井町', NULL, 187145113, 1, '7c144abe04067d2804cb70266db49ce7.1551012891.jpg', '第2学年', NULL, '留学', '2019-02-20 15:33:51', '2019-02-26 15:07:07'), (114, 'THAPA ALE', 'SHILA', 'タパ アレ ', 'シラ', 2, '18174', 'PN14997370ED', 'f', 1, '1989-07-19', '2018-04-06', '2020-03-31', '4', '2020-11-04', '埼玉県和光市白子1丁目24番6号小泉荘', '080-9201-9876', '株式会社武蔵野 朝霞工場', '048-469-1500', '埼玉県朝霞市膝折町4−14−30', '朝霞・新座', NULL, 183219114, 1, 'd2857af215201ce034ea3578c0177a62.1551012940.jpg', '第2学年', NULL, '留学', '2019-02-20 15:37:04', '2019-02-26 15:08:30'), (115, 'GIRI', 'AARATI', 'ギリ ', 'アラティ', 2, '18175', 'PN58183480EA', 'f', 1, '1993-10-25', '2018-04-06', '2020-03-31', '2', '2019-09-05', '東京都杉並区天沼1丁目17番11号 ポニーハウス', '080-85624734', NULL, NULL, NULL, NULL, NULL, 188328115, 1, 'e6f5e02d510c23399e236327c471fd7b.1551012979.jpg', '第2学年', NULL, '留学', '2019-02-20 15:39:26', '2019-02-26 15:09:02'), (116, 'THOKAR', 'MONIKA', 'トカル ', 'モニカ', 2, '18176', 'PN97447764ED', 'f', 1, '1992-04-29', '2018-04-06', '2020-03-31', '2', '2019-09-11', '埼玉県坂戸市泉町2丁目5番地5第10雲南コーポ205号室', '090-8402-3883', 'オーケー高田馬場店', '03-5927-9811', '東京都豊島区高田3-29-1', '高田馬場・目白', NULL, 184223116, 1, 'e4a8dc0e3ae9e0082890002611780d04.1551013012.jpg', '第2学年', NULL, '留学', '2019-02-20 15:42:43', '2019-02-26 15:09:48'), (118, 'RAHMAN ', 'MD MOKHLESUR', 'ラマハン ', 'エムディ モクレスル', 2, '18134', 'PN96460219EA', 'm', 9, '1996-01-01', '2018-04-06', '2020-03-31', '2', '2019-09-12', '東京都北区上十条2丁目30番11号', '070-3985-6182', '株式会社トラジ', '03-5220-7071', '東京都千代田区丸の内2-4-1丸の内ビル6F', '東京', NULL, 182102118, 1, 'b46bd1bae1751bc4a9f34b2da9065913.1551011709.jpg', '第2学年', NULL, '留学', '2019-02-21 16:06:12', '2019-02-26 14:37:34'), (119, 'IBRAHIM ', 'MD', 'イブラヒム ', 'エムディ', 2, '18151', 'PN74353119EF', 'm', 9, '1992-02-01', '2018-04-06', '2020-03-31', '4', '2020-10-24', '東京都北区中十条2丁目18番10号第一竹葉荘8号', '080-6721-4639', 'TOHOリテール(株) 丸の内ディンドン有楽町ビル店', '03-3215-8340', '東京都千代田区有楽町1−10−1有楽町ビルB1F', '有楽町・日比谷', NULL, 187543119, 1, 'c15bf15a5fd84d90b7a0c06182f8082f.1551012187.jpg', '第2学年', NULL, '留学', '2019-02-21 16:09:17', '2019-02-26 14:47:04'), (120, 'HASAN ', 'MD RABIUL', 'ハサン ', 'エムディ ラビュール', 2, '18164', 'PN90798814EA', 'm', 9, '1995-05-10', '2018-04-06', '2020-03-31', '2', '2019-05-02', '東京都北区中十条3丁目16番11-203号ジュンハイツ', '080-8882-5394', 'シエロダイニング株式会社', '03-5312-5801', '東京都新宿区新宿2-3-13大橋ビル1F', '新宿三丁目・新宿御苑前', NULL, 183484120, 1, '8e00f1dfa8c745e6d2b7839e369ac287.1551012581.jpg', '第2学年', NULL, '留学', '2019-02-21 16:13:06', '2019-02-26 15:00:19'), (121, 'YOUSU', 'MOHAMMAD ABU', 'ユウスフ ', 'モハメド アブ', 2, '18101', 'PN49083459EA', 'm', 9, '1993-04-03', '2018-04-06', '2020-03-31', '2', '2019-05-07', '埼玉県蕨市塚越5-15-10グレアーハウス205号', '070-2654-7899', '天狗', '03-3984-4551', '東京都豊島区東池袋1-3-6山手ビルB1F', '池袋駅', NULL, 181022121, 1, '87a8177e9bae8bf85dfc088fb2f42187.1551010616.jpg', '第2学年', NULL, '留学', '2019-02-22 08:10:58', '2019-03-17 09:20:04'), (122, 'TAKI ', 'UDDIN', 'タキ ', 'ウッディン', 2, '18102', 'PN27529885EA', 'm', 9, '1994-01-01', '2018-04-06', '2020-03-31', '2', '2019-06-01', '東京都北区東十条4丁目8番10-302号 結城ビル', '070-2673-5219', '株式会社グルメ杵屋', '03-5220-4085', '東京都千代田区丸の内1-9-2グラントウキョウサウスタワー地下1階', '東京', NULL, 187506122, 1, '4745cd7d140af13207bf18c2750b882c.1551010639.jpg', '第2学年', NULL, '留学', '2019-02-22 08:14:25', '2019-03-09 10:44:39'), (123, 'THAPA', 'MEGHRAJ', 'タパ ', 'メガラジ', 2, '18104', 'PN45647525EA', 'm', 1, '1991-06-28', '2018-04-06', '2020-03-31', '2', '2019-05-01', '東京都新宿区大久保2丁目25番2号レオパレス要203', '080-2805-8521', NULL, NULL, NULL, NULL, NULL, 187206123, 1, 'e9004180c02c3c0bc222a1ffd12ed49e.1551010663.jpg', '第2学年', NULL, '留学', '2019-02-22 09:37:40', '2019-03-09 10:45:03'), (124, 'KHADKA ', 'SASMITA', 'カダカ ', 'サスミタ', 2, '18105', 'PN19560958EA', 'f', 1, '1995-12-23', '2018-04-06', '2020-03-31', '2', '2019-03-27', '東京都中野区東中野4丁目5番3号コーポラス山内206', '070-4343-2892', NULL, NULL, NULL, NULL, NULL, 183164124, 1, '07c24387390a6635fbfc186b958fb3d8.1551010685.jpg', '第2学年', NULL, '留学', '2019-02-22 09:39:32', '2019-03-09 10:45:24'), (125, 'PAUDEL ', 'ARUN', 'パウデル ', 'アルン', 2, '18107', 'PN02794783EA', 'm', 1, '1993-11-08', '2018-04-06', '2020-03-31', '2', '2019-07-20', '東京都新宿区高田馬場4丁目16番1号 パークヒルズ203', '070-2161-1339', '養老乃瀧(株)', '03-3598-4060', '東京都北区1-11-4', '王子', NULL, 186558125, 1, '473b6928a1e5cc93e988de4289dc5eb9.1551010714.jpg', '第2学年', NULL, '留学', '2019-02-22 10:44:09', '2019-03-09 10:45:43'), (126, 'PANDAY ', 'SANTOSH', 'パンデ ', 'サントス', 2, '18108', 'PN87519255EA', 'm', 1, '1989-01-23', '2018-04-06', '2020-03-31', '2', '2019-09-28', '東京都豊島区要町1丁目37番16号富士コーポ205号', '070-2647-5399', NULL, NULL, NULL, NULL, NULL, 188505126, 1, '472afc48c70cf587cf6ccd88ffb8853b.1551010739.jpg', '第2学年', NULL, '留学', '2019-02-22 10:46:12', '2019-03-09 10:46:04'), (127, 'BUDHA', 'KRISHNA BAHADUR', 'ブダ ', 'クリシュナ バハドゥル', 2, '18109', 'PN12435693EF', 'm', 1, '1989-07-03', '2018-04-06', '2020-03-31', '2', '2019-05-15', '東京都国分寺市南町2-1-28 飯塚コーポ301', '070-1043-1486', 'K・LINEプリメイラ株式会社(野菜・果物の加工・盛付け)', '042-506-8355', '東京都立川市一番町 4-65-10 大清ビル西武立川・武蔵砂川', '西武立川・武蔵砂川', NULL, 182467127, 1, 'dddbd42d9167289f343dee0796c89908.1551010762.jpg', '第2学年', NULL, '留学', '2019-02-22 10:50:03', '2019-02-26 14:30:57'), (128, 'ARYAL ', 'PUNYA PRASAD', 'アレル ', 'プンヤ プラサド', 2, '18110', 'PN45811344ED', 'm', 1, '1990-12-10', '2018-04-06', '2020-03-31', '4', '2020-07-12', '埼玉県蕨市南町2-16-2', '090-4227-9143', '(株)佐々木商店', '045-581-3397', '神奈川県横浜市鶴見区元宮1-14-21', '八丁畷(はっちょうなわて)', NULL, 183798128, 1, 'edd36077e4911cce998ebe83dcf1d3e7.1551010799.jpg', '第2学年', NULL, '留学', '2019-02-22 10:55:49', '2019-02-26 14:31:49'), (129, 'BHUSAL ', 'SOBHIT', 'ブザル ソ', 'ビット', 2, '18112', 'PN07151402EA', 'm', 1, '1995-10-07', '2018-04-06', '2020-03-31', '4', '2020-08-03', '東京都新宿区中落合1丁目20番3号セベラパートⅢ303', '090-7772-4616', NULL, NULL, NULL, NULL, NULL, 183568129, 1, '5dcb66f6480b7ec19b31806509ed24c5.1551010836.jpg', '第2学年', NULL, '留学', '2019-02-22 10:58:07', '2019-02-26 14:32:03'), (130, 'SUBEDI ', 'SITA', 'スベディ ', 'シタ', 2, '18113', 'PN91206663EA', 'f', 1, '1992-02-09', '2018-04-06', '2020-03-31', '4', '2020-08-03', '東京都新宿区中落合1丁目20番3号セベラパートⅢ303', '080-3821-7289', NULL, NULL, NULL, NULL, NULL, 188726130, 1, '99ee2e6644e96a262b61a6c308822c10.1551010861.jpg', '第2学年', NULL, '留学', '2019-02-22 11:00:27', '2019-02-26 14:32:18'), (131, 'GURUNG ', 'SAROJ RAJ', 'グルン ', 'サロズ ラズ', 2, '18114', 'PN33297675EA', 'm', 1, '1989-08-12', '2018-04-06', '2020-03-31', '4', '2020-12-10', '東京都中野区上高田3丁目18番6号薬師パレスマンション402', '080-1938-5065', NULL, NULL, NULL, NULL, NULL, 185776131, 1, '57cdff1699b018a9759be31f8703aa27.1551010891.jpg', '第2学年', NULL, '留学', '2019-02-22 11:03:00', '2019-02-26 14:32:33'), (132, 'BISTA ', 'BINITA', 'ビスタ ', 'ビニタ', 2, '18115', 'PN87024883EA', 'f', 1, '1996-09-03', '2018-04-06', '2020-03-31', '4', '2020-07-25', '東京都新宿区高田馬場3丁目21番18号戸塚マンション3-C', '080-6488-4846', NULL, NULL, NULL, NULL, NULL, 189249132, 1, '92d60a3c723fd725b5e2636d7c7338b6.1551010921.jpg', '第2学年', NULL, '留学', '2019-02-22 11:05:05', '2019-02-26 14:32:47'), (133, 'MAGAR ', 'SAGAR', 'マガル ', 'サガル', 2, '18116', 'PN50779081EA', 'm', 1, '1995-04-18', '2018-04-06', '2020-03-31', '2', '2019-05-23', '東京都中野区上高田3丁目18番6号薬師パレスマンション501', '080-9851-6837', 'ローソン 中野セントラルパークイースト店', '03-3387-3930', '東京都中野区中野4-10-1', '中野', NULL, 189792133, 1, '615e2ac702b1b8a45cd6866fe84312ea.1551010945.jpg', '第2学年', NULL, '留学', '2019-02-22 11:07:13', '2019-02-26 14:33:02'), (134, 'HITANG ', 'MONIKA', 'ヒタン ', 'モニカ', 2, '18117', 'PN08935935EA', 'f', 1, '1993-03-27', '2018-04-06', '2020-03-31', '2', '2019-05-30', '東京都杉並区高円寺北2丁目34番7号マリオン高円寺103', '090-8293-7300', 'ローソン高円寺駅前店', '03-5373-8186', '東京都杉並区高円寺2-4-4', '高円寺', NULL, 187068134, 1, 'e6c81cc168aca9326e90578ae4bfc6e1.1551010976.jpg', '第2学年', NULL, '留学', '2019-02-22 11:09:23', '2019-02-26 14:33:17'), (135, 'GURUNG ', 'RAJ', 'グルン ', 'ラジ', 2, '18118', 'PN80857513EA', 'm', 1, '1994-11-25', '2018-04-06', '2020-03-31', '4', '2020-05-02', '東京都中野区上高田3丁目18番6号薬師パレスマンション402', '080-6499-7900', 'ファミリーマート', '03-5380-7208', '東京都中央区上高田2-53-5', '新富町', NULL, 185079135, 1, '78a4b5a57c93fd304799228f7d738848.1551011034.jpg', '第2学年', NULL, '留学', '2019-02-22 11:11:35', '2019-02-26 14:33:36'), (136, 'BALAMI ', 'SRIJANA', 'バラミ ', 'シリジャナ', 2, '18119', 'PN86204730EA', 'f', 1, '1993-10-23', '2018-04-06', '2020-03-31', '4', '2020-05-30', '東京都杉並区高円寺北2丁目34番7号マリオン高円寺103', '080-6489-3171', '金の蔵 新宿パレット店', '03-5909-5650', '東京都新宿区西新宿1-1-1 新宿パレットビル6F', '新宿', NULL, 188719136, 1, '2d93d4bc31b2b2d7b16601151d2e197d.1551011062.jpg', '第2学年', NULL, '留学', '2019-02-22 11:13:36', '2019-02-26 14:33:52'), (137, 'ALE ', 'KUMAR', 'アレ ', 'クマル', 2, '18120', 'PN30600314EA', 'm', 1, '1991-09-11', '2018-04-06', '2020-03-31', '2', '2019-09-18', '東京都豊島区上池袋4丁目33番20号第三福田荘 101号', '090-5841-8644', NULL, NULL, NULL, NULL, NULL, 182287137, 1, '2efbe709600ab026d45ada1848f7e803.1551011088.jpg', '第2学年', NULL, '留学', '2019-02-22 11:15:40', '2019-02-26 14:34:09'), (138, 'MADUWANTHIKA', 'KUMARI ILANGANTHILAKA', 'イランガンティラカ ', 'ムディヤンセラゲ ドゥルシャニ ', 2, '18121', 'PN32282221EA', 'f', 7, '1995-06-08', '2018-04-06', '2020-03-31', '4', '2020-08-23', '東京都中野区鷺宮5丁目2番7号ガーデンスクエア鷺ノ宮 401', '080-7701-4427', 'セブンイレブン中野沼袋駅前店', '03-3388-6895', '東京都中野区沼袋3-4-19', '沼袋', NULL, 185765138, 1, '574471ce688fe26f8d8a424f383ebcda.1551011202.jpg', '第2学年', NULL, '留学', '2019-02-22 11:20:23', '2019-03-12 17:57:49'); INSERT INTO `students` (`id`, `last_student_name`, `first_student_name`, `last_student_japanese_name`, `first_student_japanese_name`, `class_room_batch_id`, `student_number`, `residensal_card`, `student_sex`, `country_id`, `date_of_birth`, `entry_date`, `expire_date`, `residensalCardTime`, `residensal_card_expire`, `address`, `personal_phone_number`, `part_time_job_name`, `phone_where_they_works`, `address_where_they_works`, `nearest_station`, `student_note`, `unique_id`, `subject_optional_id`, `photo`, `student_of_year`, `nearest_station1`, `student_status`, `created_at`, `updated_at`) VALUES (139, 'CHAPAGAI ', 'KIRAN', 'チャパガイ ', 'キラン', 2, '18122', 'PN93583292EA', 'm', 1, '1992-02-23', '2018-04-06', '2020-03-31', '4', '2020-07-11', '東京都文京区千駄木2丁目26番6号 団子坂スカイビル501', '080-8431-3119', 'ヤマト運輸株式会社(羽田クロノゲートベース)', '03-6756-7165', '東京都大田区羽田旭町11-1', '整備場', NULL, 182522139, 1, '36469d8c71a66cf0055b2ce1e916feec.1551011234.jpg', '第2学年', NULL, '留学', '2019-02-22 11:22:26', '2019-02-26 14:34:57'), (140, 'AALE ', 'SURENDRA', 'アレ ', 'スレンドラ', 2, '18123', 'PN95520882EA', 'm', 1, '1991-12-25', '2018-04-06', '2020-03-31', '2', '2019-06-11', '東京都中野区上高田3丁目18番6号薬師パレスマンション501', '080-6489-9657', NULL, NULL, NULL, NULL, NULL, 184669140, 1, '7342152645c29fed1b2ca09bb85ca042.1551011273.jpg', '第2学年', NULL, '留学', '2019-02-22 11:24:39', '2019-02-26 14:35:12'), (141, 'DANGI', 'TILAK', 'ダンギ', 'ティラク', 1, '19130', 'PN20224418SD', 'm', 1, '1992-04-19', '2019-04-02', '2020-03-31', '2', '2019-06-08', '沖縄県うるま市安慶名2-10-13 東洋言語文化学院203号室', '090-1942-1697', 'オール・フォア沖縄株式会社', '098-917-6324', '沖縄県国頭郡恩納村字冨着志利福地原246-1                                       (カフー リゾート フチャク コンド・ホテル)', 'カフー リゾート フチャク コンド ・ホテル(バス停)', NULL, 194231141, NULL, '0.11171100 1551254267.jpg', '第1学年', NULL, '留学', '2019-02-27 13:57:47', '2019-03-15 16:45:19'), (142, 'BRANG', 'DI NAN', 'バラン', 'ディ ナン', 1, '19177', 'PN07287714EA', 'm', 8, '1988-09-22', '2019-04-02', '2021-03-31', '2', '2019-07-27', '東京都新宿区西早稲田3-20-4 金子ビル302', '080-9791-8450', '炭火亭', '03-3260-1129', '東京都新宿区神楽坂3-6 ニュージョウトーヤビル2F', '飯田橋駅', NULL, 196874142, 1, '0.16439600 1552636202.jpg', '第1学年', '高田馬場駅', '留学', '2019-03-15 21:50:02', '2019-03-15 21:50:02'), (143, 'LUM', 'DAU', 'ルマ ', 'ダウ', 1, '19178', 'PN00951563EA', 'm', 8, '1988-05-15', '2019-04-02', '2021-03-31', '2', '2019-08-27', '東京都杉並区南荻窪4-24-15 グリーンプレイス106', '070-7483-2399', 'つじ田六本木店', '03-3408-5985', '東京都港区六本木7-9-3 第1韮澤ビル1階', '六本木駅', NULL, 191730143, 1, '0.73227000 1552637570.jpg', '第1学年', '荻窪駅', '留学', '2019-03-15 22:12:50', '2019-03-15 22:12:50'); -- -------------------------------------------------------- -- -- Table structure for table `student_optionals` -- CREATE TABLE `student_optionals` ( `id` int(10) UNSIGNED NOT NULL, `class_section_student_id` int(11) NOT NULL, `subject_id` int(11) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `subjects` -- CREATE TABLE `subjects` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `subject_type` enum('compulsary','optional') COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `subjects` -- INSERT INTO `subjects` (`id`, `name`, `subject_type`, `created_at`, `updated_at`) VALUES (1, 'アート', 'optional', '2019-02-14 01:44:58', '2019-03-19 05:20:06'), (2, 'IT(ビジネス)', 'compulsary', '2019-03-19 05:21:14', '2019-03-19 05:21:14'), (3, 'IT 1', 'compulsary', '2019-03-19 05:21:41', '2019-03-19 05:21:41'), (4, 'IT 2デザイン', 'compulsary', '2019-03-19 05:22:08', '2019-03-19 05:22:08'), (5, '日本語', 'compulsary', '2019-03-19 05:22:21', '2019-03-19 05:22:21'); -- -------------------------------------------------------- -- -- Table structure for table `teachers` -- CREATE TABLE `teachers` ( `id` int(10) UNSIGNED NOT NULL, `photo` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `last_teacher_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `first_teacher_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `last_teacher_japanese_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `first_teacher_japanese_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `teacher_sex` enum('m','f','o') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'm', `country_id` int(11) DEFAULT NULL, `subject_id` int(11) DEFAULT NULL, `teacher_number` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `date_of_birth` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `address` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `personal_phone_number1` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `personal_phone_number2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `personal_phone_number3` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `teacher_note` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `teacher_subjects` -- CREATE TABLE `teacher_subjects` ( `id` int(10) UNSIGNED NOT NULL, `subject_id` int(11) NOT NULL, `teacher_id` int(11) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `role_id` int(10) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`, `role_id`) VALUES (1, 'admin', 'admin@gmail.com', NULL, '$2y$10$2OF9vOa1F16CblVHBWdoeOUI6ZYDl6HGxPm8kOzoA.tGGmXzI.6Vi', 'ciuhQb0n1Dp8CVIdqrwnA5zt06k6KMz8Bmztny29UDOPpFgbQBVQwpU3uFlz', NULL, NULL, 1), (2, 'staff', 'staff@gmail.com', NULL, '$2y$10$78tDiJVLRR9HCkhnfWX0Uuo53olid4TMex06rMPvgjar4o6CWsVMO', NULL, NULL, NULL, 2); -- -- Indexes for dumped tables -- -- -- Indexes for table `attendances` -- ALTER TABLE `attendances` ADD PRIMARY KEY (`id`), ADD KEY `attendances_student_id_foreign` (`student_id`); -- -- Indexes for table `batches` -- ALTER TABLE `batches` ADD PRIMARY KEY (`id`); -- -- Indexes for table `categories` -- ALTER TABLE `categories` ADD PRIMARY KEY (`id`); -- -- Indexes for table `class_batch_sections` -- ALTER TABLE `class_batch_sections` ADD PRIMARY KEY (`id`); -- -- Indexes for table `class_batch_subjects` -- ALTER TABLE `class_batch_subjects` ADD PRIMARY KEY (`id`); -- -- Indexes for table `class_rooms` -- ALTER TABLE `class_rooms` ADD PRIMARY KEY (`id`); -- -- Indexes for table `class_room_batches` -- ALTER TABLE `class_room_batches` ADD PRIMARY KEY (`id`); -- -- Indexes for table `class_section_days` -- ALTER TABLE `class_section_days` ADD PRIMARY KEY (`id`); -- -- Indexes for table `class_section_students` -- ALTER TABLE `class_section_students` ADD PRIMARY KEY (`id`); -- -- Indexes for table `countries` -- ALTER TABLE `countries` ADD PRIMARY KEY (`id`); -- -- Indexes for table `holidays` -- ALTER TABLE `holidays` ADD PRIMARY KEY (`id`); -- -- Indexes for table `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`); -- -- Indexes for table `residensal_card_times` -- ALTER TABLE `residensal_card_times` ADD PRIMARY KEY (`id`); -- -- Indexes for table `roles` -- ALTER TABLE `roles` ADD PRIMARY KEY (`id`); -- -- Indexes for table `sections` -- ALTER TABLE `sections` ADD PRIMARY KEY (`id`); -- -- Indexes for table `section_periods` -- ALTER TABLE `section_periods` ADD PRIMARY KEY (`id`), ADD KEY `section_periods_c_s_id_foreign` (`c_s_id`); -- -- Indexes for table `students` -- ALTER TABLE `students` ADD PRIMARY KEY (`id`); -- -- Indexes for table `student_optionals` -- ALTER TABLE `student_optionals` ADD PRIMARY KEY (`id`); -- -- Indexes for table `subjects` -- ALTER TABLE `subjects` ADD PRIMARY KEY (`id`); -- -- Indexes for table `teachers` -- ALTER TABLE `teachers` ADD PRIMARY KEY (`id`); -- -- Indexes for table `teacher_subjects` -- ALTER TABLE `teacher_subjects` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_email_unique` (`email`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `attendances` -- ALTER TABLE `attendances` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; -- -- AUTO_INCREMENT for table `batches` -- ALTER TABLE `batches` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `categories` -- ALTER TABLE `categories` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; -- -- AUTO_INCREMENT for table `class_batch_sections` -- ALTER TABLE `class_batch_sections` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `class_batch_subjects` -- ALTER TABLE `class_batch_subjects` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `class_rooms` -- ALTER TABLE `class_rooms` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `class_room_batches` -- ALTER TABLE `class_room_batches` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `class_section_days` -- ALTER TABLE `class_section_days` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `class_section_students` -- ALTER TABLE `class_section_students` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `countries` -- ALTER TABLE `countries` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `holidays` -- ALTER TABLE `holidays` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22; -- -- AUTO_INCREMENT for table `residensal_card_times` -- ALTER TABLE `residensal_card_times` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `roles` -- ALTER TABLE `roles` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `sections` -- ALTER TABLE `sections` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `section_periods` -- ALTER TABLE `section_periods` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `students` -- ALTER TABLE `students` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=144; -- -- AUTO_INCREMENT for table `student_optionals` -- ALTER TABLE `student_optionals` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `subjects` -- ALTER TABLE `subjects` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `teachers` -- ALTER TABLE `teachers` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `teacher_subjects` -- ALTER TABLE `teacher_subjects` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- Constraints for dumped tables -- -- -- Constraints for table `attendances` -- ALTER TABLE `attendances` ADD CONSTRAINT `attendances_student_id_foreign` FOREIGN KEY (`student_id`) REFERENCES `students` (`id`); -- -- Constraints for table `section_periods` -- ALTER TABLE `section_periods` ADD CONSTRAINT `section_periods_c_s_id_foreign` FOREIGN KEY (`c_s_id`) REFERENCES `class_batch_sections` (`id`); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
true
dc15c1f178c56be9a06b6379b75945d1704bb50a
SQL
YairPR/Oracle
/Scripts/size_bd_obj/top_10_xtablespace.sql
UTF-8
322
3.171875
3
[]
no_license
select * from (select owner as "Schema" , segment_name as "Object Name" , segment_type as "Object Type" , round(bytes/1024/1024/1024,2) as "Object Size (Mb)" , tablespace_name as "Tablespace" from dba_segments where tablespace_name ='&tbsname' and segment_type in ('TABLE','INDEX') order by 4 desc ) where rownum < 11 /
true