text
stringlengths
6
9.38M
alter table users add (level int); alter table users add (login int); alter table users add (recommend int); alter table users add (email varchar not null); alter table users alter level int not null; alter table users alter login int not null; alter table users alter recommend int not null;
-- phpMyAdmin SQL Dump -- version 4.6.5.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Apr 24, 2017 at 10:32 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...
-- phpMyAdmin SQL Dump -- version 5.0.1 -- https://www.phpmyadmin.net/ -- -- Hôte : 127.0.0.1 -- Généré le : mer. 20 mai 2020 à 00:35 -- Version du serveur : 10.4.11-MariaDB -- Version de PHP : 7.4.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SE...
INSERT INTO f_prod_totalt_NCS_year VALUES (1971, 0.357000, 0.000000, 0.000000, 0.000000, 0.357000, 0.000000); INSERT INTO f_prod_totalt_NCS_year VALUES (1972, 1.927000, 0.000000, 0.000000, 0.000000, 1.927000, 0.000000); INSERT INTO f_prod_totalt_NCS_year VALUES (1973, 1.870000, 0.000000, 0.000000, 0.0...
DROP TABLE IF EXISTS `rda`.`rdadata`.`time_shift_xref`; CREATE TABLE `rda`.`rdadata`.`time_shift_xref` ( calendar_date, month_of_year, day_of_month, year_of_calendar, year_of_calendar_shift, day_of_week, week_of_year, quarter_of_year, day_of_year, n_shift, day_of_year_shift ) PARTITION BY (calendar_da...
create table MiRNA ( version bigint(20) not null, id bigint(20) not null, name varchar(255) not null, type varchar(255) not null, primary key (id) ) engine=INNODB charset=utf8 collate=utf8_spanish_ci; create table Author ( version bigint(20) not null, id int(11) not null, name text not...
SELECT si.pid, u.usename AS user, qs.state, si.xid, qs.exec_time / 1000000 AS exec_time, qs.queue_time / 1000000 AS queue_time, si.starttime, si.text FROM stv_inflight AS si LEFT JOIN stv_wlm_query_state AS qs ON si.query = qs.query LEFT JOIN pg_user AS u ON u.usesysid = si.userid ORDER BY...
select count(*) from award_cd_err_no_money where "Document Status" = 'F'; select unique "Document Status" from award_cd_err_no_money; select ti.obligated_change,t.award_number,t.update_timestamp,t.transaction_type_code,t.transaction_id from award_amount_transaction t, award_amount_info ti where t.award_number ...
-- ----------------------------------------------------- -- Table `user` -- ----------------------------------------------------- CREATE TABLE `user` ( `user_id` INT NOT NULL AUTO_INCREMENT COMMENT 'user id', `nickname` VARCHAR(50) NOT NULL COMMENT 'nickname', `password` VARCHAR(255) NOT NULL COMMENT '암호회된 password'...
CREATE TABLE public.da_bill_type ( bill_type_cd character varying(15), bill_type_name character varying(64), bill_type_desc character varying(128), record_status character(1), loc_cd character varying(16), org_cd character varying(8), grp_cd character varying(8), dw_facility_cd character...
SELECT SUM(ISNULL(WITHDRAW_RESULT_AMOUNT,0)) AS SUM_WITHDRAW_RESULT_AMOUNT -- SUM(回収実績額) FROM REQUST_WITHDRAW_INFO -- 請求回収情報 WHERE CONTRACT_NO = /*contractNo*/ -- 契約番号 AND (WITHDRAW_STATUS = CAST(/*partWithdrawed*/ AS CHAR(1)) OR WITHDRAW_STATUS = CAST(/*withdrawed*/ AS CHAR(1))...
CREATE TABLE articles ( name text, price text, author bigserial, guild bigserial, messageId bigserial, channel bigserial, link text, buyer bigserial, id bigserial ); CREATE TABLE channels ( id bigserial, guild bigserial, type text ); CREATE TABLE moneys ( guild bigserial, moneys text ); CREATE TABLE se...
USE ieq9ik070kk48ciu; CREATE TABLE todos ( id INT AUTO_INCREMENT NOT NULL, description VARCHAR(255), createdAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updateAt TIMESTAMP, PRIMARY KEY(id) );
-- phpMyAdmin SQL Dump -- version 4.6.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: 20-Jul-2017 às 17:42 -- Versão do servidor: 5.7.14 -- PHP Version: 5.6.25 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */...
set echo off newpage 0 space 0 pagesize 32767 feed off head off underline off trimspool on termout off linesize 4000 -------------------------------------------------------- -- File created - Monday-September-24-2018 -------------------------------------------------------- --------------------------------------------...
alter function sf_alumnosAleph (@clectivo varchar(4),@sesion varchar(1),@clase varchar(6)) returns table as return ( SELECT DOC.NATIONAL_ID collate Latin1_General_CI_AS AS ID, PER.EMPLID collate Latin1_General_CI_AS AS COD_BAR, (NOM.LAST_NAME + ' ' + NOM.SECOND_LAST_NAME + ' ' + NOM.FIRST_NAME) collate Latin1_General...
-- phpMyAdmin SQL Dump -- version 4.2.7.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Jun 02, 2017 at 09:35 AM -- Server version: 5.6.20 -- PHP Version: 5.5.15 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */...
select * from users_new INNER JOIN backpack ON backpack.uniquePack = users_new.packID
-- 메뉴 ALTER TABLE menu DROP CONSTRAINT FK_restaurant_TO_menu; -- 식당 업로드 -> 메뉴 -- 메뉴 ALTER TABLE menu DROP CONSTRAINT FK_MEMBER_TO_menu; -- 회원 -> 메뉴 -- 메뉴 ALTER TABLE menu DROP CONSTRAINT PK_menu; -- 메뉴 기본키 -- 메뉴 DROP TABLE menu; -- 메뉴 CREATE TABLE menu ( menunum NUMBER(8) NOT NULL, -- 메뉴번호 menuname VARC...
/* Host: {host} Username: {username} Password: {password} */ -- 01 -- SELECT all columns and rows from the Customers table SELECT * FROM Customers; -- 02 -- How do we know which columns are available? DESCRIBE Customers; -- 03 -- SELECT specific columns - CustomerID, CustFirstName, CustZipCode SELECT CustomerID, C...
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64) -- -- Host: 35.198.218.250 Database: ckp -- ------------------------------------------------------ -- Server version 5.7.21 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*...
-- @C:\Users\Kaustav\Desktop\sqlPractice\UniversityDB\DDL+drop.sql -- @C:\Users\Kaustav\Desktop\sqlPractice\UniversityDB\smallRelationsInsertFile.sql select name from instructor where instructor.ID ='22222'; select instructor.id, department.building from instructor, department where instructor.dept_name='Physics'; ...
ALTER TABLE tastings ADD COLUMN userId INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE;
/************************************************************************************************************** * Script: Shows Count Assign for specific profile. * * PURPOSE: * - This script will show you the count assign of the provided profile ID. * * * NOTES: * - Change the XX in RED with...
--Thanks to https://towardsdatascience.com/sql-tricks-for-data-scientists-53298467dd5 -- Find a Repeating Event SELECT a.first_name, a.last_name, f.title FROM actor a JOIN film_actor fa ON fa.actor_id = a.actor_id JOIN film f ON f.film_id = fa.film_id; SELECT a.first_name, fa.film_id, f.title FROM actor a LEFT J...
SELECT * FROM Shohin ORDER BY torokubi DESC ;
select * from bookings b where book_ref in (select book_ref from tickets t where ticket_no in ( select count(1) from ticket_flights tf where not exists (select 1 from boarding_passes bp where tf.flight_id=bp.flight_id and tf.ticket_no=bp...
/* Navicat Premium Data Transfer Source Server : pgsql Source Server Type : PostgreSQL Source Server Version : 100013 Source Host : 132.232.2.109:5432 Source Catalog : netcoredev Source Schema : public Target Server Type : PostgreSQL Target Server Version : 100013 File...
-- Reescribir la siguiente consulta con JOIN /* SELECT trackid, name FROM tracks WHERE albumid = ( SELECT albumid FROM albums WHERE title = 'Let There Be Rock' ); */ SELECT trackid, name FROM tracks INNER JOIN albums ON albums.albumid = tracks.albumid WHERE albums.title = 'L...
-- THIS REPORT GETS A COUNT OF HOW MANY MEDICATIONS READMISSION PATIENTS ARE ON -- THIS IS FOR THE READMISSIONS TASK FORCE, DATA FOR 2012 --********************************************************************************* SELECT cv.visitIDCode, COUNT(d.ReconcileComment) AS "# Meds per DC Rec." FROM CV3clientvisit...
update publisher set name = 'Prentice Hall' where name is 'PHI';
CREATE DATABASE `task` CHARACTER SET utf8 COLLATE utf8_general_ci;
SELECT * FROM HeloUsers WHERE username = $1 AND password = $2;
-- phpMyAdmin SQL Dump -- version 3.2.4 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Aug 25, 2015 at 08:10 PM -- 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_S...
create table education ( edu_id int primary key auto_increment, edu_name varchar(1024) not null ); create table education_doc ( edu_id int, doc_id int, foreign key(doc_id) references doctor(doc_id), foreign key(edu_id) references education(edu_id) );
/* Napomena: A. Prilikom bodovanja rješenja prioritet ima rezultat koji upit treba da vrati (broj zapisa, vrijednosti agregatnih funkcija...). U slučaju da rezultat upita nije tačan, a rezultat tog upita se koristi u narednim zadacima, tada se rješenja narednih zadataka, bez obzira na tačnost koda, ne boduju punim...
CREATE TABLE users( [user_id][int] IDENTITY (1,1) NOT NULL , [username][varchar](30) NOT NULL UNIQUE, [password][varchar](300) NOT NULL, [FirstName][varchar](200) NOT NULL, [LastName][varchar](200) NOT NULL, [Email][varchar](200) NOT NULL, [Country][varchar](200) NOT NULL, [Image][varchar](200) N...
CREATE PROCEDURE GetOldNinjas --@param1 int = 0, --@param2 int AS SELECT * FROM Ninjas WHERE DayOfBirth <= '1990-01-01' --RETURN 0
CREATE TABLE `ts_opus_photo` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '图片ID', `publisherid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '发布者ID', `authorsid` int(11) unsigned DEFAULT '0' COMMENT '图片作品作者表ID', `exifid` int(11) unsigned DEFAULT '0' COMMENT '图片数据表ID', `name` varchar(128) NOT NULL ...
IF OBJECT_ID(N'dbo.teams', N'U') IS NULL BEGIN CREATE TABLE teams ( id INTEGER NOT NULL IDENTITY(1,1) PRIMARY KEY, name NVARCHAR(512) NOT NULL ); END; -- STATEMENT MARKER IF OBJECT_ID(N'dbo.results', N'U') IS NULL BEGIN CREATE TABLE results ( id INTEGER NOT NULL IDENTITY(1,1) PRIMARY KEY, team_id ...
create table teachers( id integer primary key autoincrement, first_name text not null, last_name text not null, email text not null, school text not null, submission date not null, q1 text not null, q2 text not null, q3 text not null, q4 text not null, q5 text not ...
--harrise setup grant u_group_super to harrise; Insert into USER_MASTER (LOGIN_ID,INITIALS,FULL_NAME,EMAIL_ADDRESS,OFFICE_PHONE,MOBILE_PHONE,OFFICE_FAX,MGR_ID,PRINTER_NAME,ACCOUNT_CODE,DEACTIVE_DATE) values ('HARRISE','EDHA','EDDIE HARRIS','harrise@SAGE.com.au','(08) 9241 1475',null,'(08) 9241 0155','DCP','\\vhho...
INSERT INTO Albums (AId, Title,`Year`, Label,`Type`) VALUES (1,'Le Pop',2008,'Propeller Recordings','Studio'), (2,'A Kiss Before You Go',2011,'Propeller Recordings','Studio'), (3,'A Kiss Before You Go: Live in Hamburg',2012,'Universal Music Group','Live'), (4,'Rockland',2015,'Propeller Recordings','Studio'); INSERT IN...
select document_type "Document Type", to_char(totalChars,'999,999,999,999') "Character Total", to_char(numDocs,'999,999') "Number of Documents", to_char(size__pct_dec*100,99.9) "Size Percent", to_char(count_pct_dec*100,99.9) "Count Percent" from ( select document_type,totalChars,ratio_to_...
-- If any of these fields have been utilized then they should be transferred to tags ALTER TABLE site DROP COLUMN address, DROP COLUMN area, DROP COLUMN contractor, DROP COLUMN country, DROP COLUMN customer_device_type, DROP COLUMN direction, DROP COLUMN latitude, DROP COLUMN location_type, DROP COLUMN longitude, DROP...
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: May 09, 2018 at 01:00 PM -- Server version: 10.1.19-MariaDB -- PHP Version: 7.2.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; -- -- Database: `register` -- -- -------------------------...
use parseplanroom; drop table ProjectHistory; drop table Projects; CREATE TABLE Projects( Id int not null, ProjectId nvarchar(100) NOT NULL, ProjectName nvarchar(500) NOT NULL, ProjectStatus nvarchar(100) NOT NULL, ProjectLink nvarchar(max) NOT NULL, Section1 nvarchar(max), Section2 nvarchar(max), Section3 nv...
TRUNCATE TABLE OLE_CAT_REC_TYP_T DROP STORAGE / INSERT INTO OLE_CAT_REC_TYP_T (REC_TYP_ID,OBJ_ID,VER_NBR,REC_TYP_CD,REC_TYP_NM,SRC,SRC_DT,ROW_ACT_IND) VALUES (1.0,'051945bf-3fb3-4d3b-bfc3-a2101b3ffebf',1.0,'u','Unknown','MFHD Leader 06: http://www.loc.gov/marc/holdings/hdleader.html',TO_DATE( '20120322000000', 'YYYYM...
select tfiles.tablespace_name, sum(su.extents*tbl.next_extent)/(1024*1024) TEMP_USED, tfiles.TOTAL_TEMP from v$sort_usage su, dba_tablespaces tbl, (select distinct tablespace_name, sum(bytes)/(1024*1024) TOTAL_TEMP from dba_temp_files group by tablespace_name) tfiles where tablespace='TEMP' and su.tablespace=tbl.table...
select 1 from dual union all select 2 from dual
CREATE TABLE users ( id INTEGER PRIMARY KEY, fname TEXT NOT NULL, lname TEXT NOT NULL ); CREATE TABLE questions( id INTEGER PRIMARY KEY, title TEXT NOT NULL, body TEXT, author_id INTEGER NOT NULL, FOREIGN KEY (author_id) REFERENCES users(id) ); CREATE TABLE questions_follows ( id INTEGER PRIMARY KEY, question_id I...
--AP Database select distinct VendorName from Vendors join Invoices on Vendors.VendorID = Invoices.VendorID where VendorState = 'CA' order by VendorName desc select AccountDescription from GLAccounts left outer join InvoiceLineItems on GLAccounts.AccountNo = InvoiceLineItems.AccountNo where InvoiceLine...
SELECT DISTINCT "bmat_test_song"."id", "bmat_test_song"."title", "bmat_test_song"."performer_id", COUNT("bmat_test_play"."id") AS "play_count" FROM "bmat_test_song" INNER JOIN "bmat_test_play" ON ("bmat_test_song"."id" = "bmat_test_play"."song_id") INNER JOIN "bmat_test_radiostation" ON ("bmat_test_play"."radio_sta...
use codeup_test_db; create table inventory( id INT NOT NULL AUTO_INCREMENT, name varchar(100), price int(11) not null, isSold boolean, primary key(id)); insert into inventory(name, price,isSold) values("widget","4.00",true), ("thing","2.00",false), ("Whatsit","9.00",true), ("Gadget","3.00",true);
-- phpMyAdmin SQL Dump -- version 4.7.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: May 02, 2019 at 08:40 AM -- Server version: 10.1.22-MariaDB -- PHP Version: 7.1.4 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD...
drop database if exists basic_employment_agency; create database if not exists basic_employment_agency default character set utf8 default collate utf8_general_ci; use basic_employment_agency; drop table if exists user; create table if not exists user( user_id int auto_increment, login_id int, access_id tiny...
create table csv( id INT, note STRING, country STRING, record_time TIMESTAMP(4), doub_val DECIMAL(6, 2)) with ( 'connector.type' = 'filesystem', 'connector.path' = '/Users/bang/sourcecode/project/Improve/flinkstream/src/main/resources/test.csv', 'format.type' = 'csv') create table csvSink( jnlno STRING, taskid cha...
/* * private int report_num; private String report_type; // 게시글 , 댓글 private int pk_num; // pk 번호 private String report_div; // 홍보글, 19 음란물, 기타 private String user_id; // 신고당한자 private String report_id; // 신고자 private String report_contents; // 내용 private String report_result; // 통과, 실패 priv...
SELECT * FROM CITY C WHERE C.COUNTRYCODE = 'JPN';
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Feb 28, 2017 at 08:50 PM -- Server version: 10.1.19-MariaDB -- PHP Version: 7.0.13 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL...
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Nov 22, 2018 at 07:55 AM -- Server version: 10.1.36-MariaDB -- PHP Version: 7.2.11 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OL...
undefine l_colors define l_colors = "&1" set feedback on prompt .. Setting colors. (colors="&&l_colors") set feedback off declare l_colors varchar2(255) := upper('&&l_colors') ||'_COLORS'; begin debug_format.set_colors(l_colors); end; / set feedback on prompt done prompt undefine l_colors
CREATE TYPE USERTYPE AS ENUM('operator', 'admin'); CREATE TABLE IF NOT EXISTS "user"( id SERIAL PRIMARY KEY, name VARCHAR(32) NOT NULL, password VARCHAR(32) NOT NULL, type USERTYPE NOT NULL );
-- phpMyAdmin SQL Dump -- version 5.1.0 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Jul 15, 2021 at 09:20 PM -- Server version: 10.4.18-MariaDB -- PHP Version: 7.3.27 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIE...
CREATE database serviceexchange; use serviceexchange; CREATE TABLE User ( username VARCHAR(30), password VARCHAR(255), usertype VARCHAR(10) NOT NULL DEFAULT 'ROLE_user', nickname VARCHAR(30) UNIQUE, firstname VARCHAR(20) NOT NULL, lastname VARCHAR(20) NOT NULL, gender CHAR(...
-- abrindo banco de dados use posfib; -- criando view create view vwprodutos as select codprod as 'Codigo', produto, preco as 'Preco Atual', preco * 1.1 as 'Preco com reajuste', codfor from produtos where codprod > 2; -- alterando view alter view vwprodutos as select codpro...
select round(max(salary)) as maximum ,round(min(salary)) as minimum ,round(avg(salary)) as average ,round(sum(salary)) as Sum from employees; select salary from employees; select job_id ,round(max(salary)) as maximum ,round(min(salary)) as minimum ,round(avg(salary)) as ave...
CREATE PROC [PLE].[Usp_Del_T12TipoOperacion] @ID INT AS BEGIN DELETE FROM [PLE].[T12TipoOperacion] WHERE ID = @ID END
// MongoDB "DDL" initialize the dev database with airports collection. // Chris Joakim, Microsoft, 2021/01/31 use dev db.airports.drop() db.createCollection("airports") db.airports.ensureIndex({"pk" : 1}, {"unique" : false}) db.airports.ensureIndex({"iata_code" : 1}, {"unique" : false}) db.airports.ensureIndex({"name...
// Results Working Around Tables ------------------------------------------------------ Write a query in SQL to display the full name (first and last name), and salary for those employees who earn below 6000. SELECT first_name, last_name, salary FROM employee WHERE salary < 6000; -----------------------------------...
-- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Aug 24, 2019 at 06:13 PM -- Server version: 10.1.28-MariaDB -- PHP Version: 7.0.25 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OL...
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Mar 26, 2017 at 05:16 AM -- Server version: 10.1.16-MariaDB -- PHP Version: 7.0.9 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI...
SELECT * FROM (SELECT variable, category, CASE WHEN sortorder IS NULL THEN CASE WHEN category = 'Unknown' THEN 90 WHEN category = 'unknown' THEN 90 WHEN category = 'Other' THEN 89 ELSE 0 END ELSE sortorder END AS sortorder FROM ( SELECT 'Timepoin...
SELECT * FROM posts JOIN users ON posts.author_id = users.user_id WHERE NOT user_id = ($1) AND title LIKE ($2);
update payment_transactions set amount = abs(amount) where amount < 0;
drop table if exit tb_user; create table tb_user( id int(11) not null auto_increment, name varchar(32) not null, password varchar(32) not null , nickName varchar(32) default null, synopsis varchar (128) default null comment '简介', sex ENUM('1','2','0') default '0' comment '1男2女0保密', phone char(11) default null, ...
# LIMIT : 추출할갯수 # OFFSET : SKIP 할갯수 # ex. LIMIT 2 OFFSET 0 : 처음수를 포함해서 2개 추출(OFFSET 이 0이면 생략가능) SELECT tempTable.ANIMAL_ID, tempTable.NAME FROM (SELECT a.ANIMAL_ID, a.NAME, DATEDIFF(b.DATETIME,a.DATETIME) AS DATEDIFF FROM ANIMAL_INS a INNER JOIN ANIMAL_OUTS b ON a.ANIMAL_ID = b.ANIMAL_ID) AS tempTable ORDER BY DATEDIFF...
DROP DATABASE IF EXISTS rosteritup_db; CREATE DATABASE rosteritup_db; USE rosteritup_db;
/* Formatted on 17/06/2014 18:06:14 (QP5 v5.227.12220.39754) */ CREATE OR REPLACE FORCE VIEW MCRE_OWN.V_MCRE0_ST_GRUPPO_LEGAME ( ID_DPER, COD_SNDG, COD_GRUPPO_LEGAME, COD_LEGAME, FLG_CAPOLEGAME ) AS WITH c AS (SELECT DISTINCT ID_DPER, COD_SNDG, ...
CREATE ALGORITHM = UNDEFINED DEFINER = `capstone`@`%` SQL SECURITY DEFINER VIEW `highscore_listing` AS SELECT `sl`.`level_id` AS `level_id`, `sl`.`end` AS `end`, MAX(`sl`.`score`) AS `highscore`, CAST(SUBSTR(sl.level_id, 6) AS UNSIGNED INT) AS LevelNumber FROM (`l...
INSERT INTO department (department) VALUES ("Engineering"); INSERT INTO department (department) VALUES ("Marketing");
ALTER TABLE audits ADD CONSTRAINT solution_unique UNIQUE (solutionid); ALTER TABLE solutions ADD CONSTRAINT user_homework_unique UNIQUE (userid, homeworkid);
-- Узнать максимальное время задержки вылетов самолетов select max (actual_departure - scheduled_departure) as max_diff from flights_v where status in ('Delayed', 'Departed', 'Arrived');
(SELECT row_to_json(employees) FROM "villamil_northwind".employees);
create table product ( id SERIAL PRIMARY KEY, ean text, name text, description text ); insert into product(ean,name,description) values ('111','Buch','xxxxxxx'); insert into product(ean,name,description) values ('222','Auto','yyy yyyy yyyy'); insert into product(ean,name,description) values ('333','Flugzeug','zzzzz...
--we must generate the list of Features at RunTime, replaceing '{Features}' with a list in the style of -- [0_001_00],[0_020_00],[0_007_02] -- Append to Where Clause the logic for filtering out failures, but Not NULL values SELECT Pvt.* FROM (SELECT src.FeatureName, src.ObsID, src.Value FROM (SELECT f.Featur...
/* Formatted on 17/06/2014 18:10:46 (QP5 v5.227.12220.39754) */ CREATE OR REPLACE FORCE VIEW MCRE_OWN.V_MCRES_APP_ORGANI_DELIBERANTI ( COD_ISTITUTO, COD_ABI, DESC_ISTITUTO, COD_UO, DESC_PRESIDIO, COD_ORGANO_DELIBERANTE, DESC_ORGANO_DELIBERANTE, DTA_INIZIO, DTA_SCADENZA, DESC_RESPONSABILE )...
-- :name newMarriage :affected INSERT INTO Weddings (partner1, partner2) VALUES (:id1, :id2)
set verify off set linesize 300 column file_name format a80 --column "SIZE (MB)" format a35 --column "MAXSIZE (MB)" format a35 --accept tbname - -- prompt 'Tablespace: ' SELECT file_id, file_name, trunc(bytes/1024/1024) as "SIZE (MB)", trunc(maxbytes/1024/1024) as "MAXSIZE (MB)", round(increment_by*8192...
create table app.student( id integer not null generated always as identity, sno varchar(50) not null, name varchar(30) not null, gender char(1) not null, telephone varchar(50), primary key (id) ); create table app.student_detail( id integer not null, birthday timestamp, address varc...
-- Joining 2 tables SELECT e.emp_no, e.first_name, e.last_name, ti.title, ti.from_date, ti.to_date INTO retiring_employees FROM employees as e Right JOIN titles as ti ON (e.emp_no = ti.emp_no) WHERE (birth_date BETWEEN '1952-01-01' AND '1955-12-31') ORDER BY emp_no ASC; SELECT * FROM retiring_emplo...
CREATE TABLE Wlasciciel_Pojazdu ( Id_Wlasciciela Integer NOT NULL, Imie Varchar2(30 ) NOT NULL, Nazwisko Varchar2(30 ) NOT NULL, Miasto Varchar2(30 ) NOT NULL, Ulica Varchar2(30 ) NOT NULL, Nr_Budynku Number NOT NULL, Nr_Mieszkania Number, Nr_telefonu Varchar2(30 ), Adres_email Varchar2(30 ), Staly...
drop table if exists users; drop table if exists roles; create table roles ( id smallserial primary key, name varchar(16) not null unique ); insert into roles (name) values ('administrator'); insert into roles (name) values ('user'); create table users ( id serial primary key, name varchar(64) not null,...
ALTER TABLE STUDIO ADD COLUMN President Name TEXT
select * from PRODUCT_BLUEPRINT order by PRODUCT_GROUP
[VerificaAcesso(Acesso.cad_cli)] public ActionResult ClienteFicha(string id) { Cadastro ret = (Cadastro)_repository.ObtemClienteFicha(id); if (TempData["mensagem"] != null) { ret.sucesso = false; ret.mensagem = TempData["mensag...
ALTER TABLE `lttx1_log` ADD COLUMN `log_type` INT(3) NULL DEFAULT '0' AFTER `message`;
DROP TABLE IF EXISTS Payments; DROP TABLE IF EXISTS Room_Reservation; DROP TABLE IF EXISTS Locked; DROP TABLE IF EXISTS Room; DROP TABLE IF EXISTS Category; DROP TABLE IF EXISTS Service_reservation; DROP TABLE IF EXISTS Service; DROP TABLE IF EXISTS Employee; DROP TABLE IF EXISTS Creditcard; DROP TABLE IF EXISTS Custom...
ALTER TABLE tb_grupo AUTO_INCREMENT = 1; ALTER TABLE tb_usuario AUTO_INCREMENT = 1; ALTER TABLE tb_permissao AUTO_INCREMENT = 1;
SELECT * FROM users WHERE userid=$1;