How to create a database table and query itThere are many ways to create a data table. The following are some common methods:
- ** Create based on T-sql **: Before creating the data table, start the database first (for example, through the `use` statement). When creating a table, the field information of the data table must be determined according to the business requirements, including the field name, type, and so on. The table and the field complement each other. When creating a table structure, the fields were separated by commas. The last field did not need a commas. For example, create a data table named `student_num':`create table student_num1 (num1 varchar(10), num2 int(20), num3 int(30) );`To specify table options, such as storage engine, character set, etc., you can create it like`create table student3( name varchar(40))engine Innobb charset utf8Mb4;` The primary key must be set when creating the data table, and the primary key must be unique.
- ** Manual Creation with Navicat Prenium **: This method can be used when creating a data table based on data from, for example, excel sheets. First, create a database (such as right-clicking the new database and setting relevant parameters such as character sets), then right-click the "Table" of the new database, select the import wizard to manually import the data table, and follow the wizard steps, such as selecting the excel file type, determining the name of the data table, etc.
You can use the following methods to query the data table:
- ** Basic query statement **:`select * from` table name is used to query all the data in the table. You can also specify a column to query, such as `select empno, username from emp;`. You can also add an alias to the column to improve the legibility, such as `select empno employee number, username name, job, sal salary from emp;`.
- ** Use wildcards to query **:`%` can match 0 or any number of characters,`_`(glyph) matches one character,`= ` is used for precise matching,`like` is used for fuzzy matching, and `regexp` is used for regular expression matching. For example, you can use `select * from emp where name regexp '^a';` to query all the information of people whose name begins with `a`.
- ** Order the query results **: Use the keyword `order by`. The default is ascending order. You can also specify `asc` ascending order or `desc` descending order. For example,`select * from emp order by deptno asc ;` sort by ascending order of `deptno` column.
- ** Duplicated query results **: Use the keyword `distinct`, such as `select distinct deptno from emp;`.
- ** Group query and filtering results **:`group by` performs group statistics on the query results based on each member of a given sequence. It is only meaningful when used together with an accumulation function (such as `max` maximum value,`min` minimum value,`sum` total sum,`avg` average value,`count` total number). For example,`select deptno,max(sal) from emp group by deptno;` find the highest salary of each department. `having` is used to filter the results after grouping, such as `select deptno,max(sal),count(*) from emp group by deptno having count(*)>5;`.
"Choose" was equally exciting. Everyone was welcome to read it!
Zhang Yue 30 Only Personal IntroductionYue Zhang was born in Beijing City on September 14, 1994. She graduated from the Beijing Dance Academy and was an actress, singer, and member of the female singing group,"You Wo Girl Group". In July 2020, Zhang Yue played the role of Lin Youyou, the " scheming woman " in the urban romance drama " Only Thirty." With this character, she won the third " Film and Television Model·2020 Annual Overall Rating List " popular supporting actress and began to gain attention.
The original work was equally exciting. You could click on the original work of " The Story of Rose " to understand the plot in advance!
Qin Ziyao and Xiaoyu's EndingAccording to the plot of the TV series, Qin Ziyao finally moved Xiaoyu with her sincerity through her own efforts. Xiaoyu found that her ex-boyfriend was unreliable and finally accepted Qin Ziyao and got married.
While waiting for the anime, you can also click on the link below to read the classic original work of The King's Avatar!
What are the books about the double male protagonist's school novel?The following were some of the top students 'novels with two male leads: " The Love Between Two Top Students Is Worth Having ". Lin Mo wrote about how he was skinny, good-looking, and scored 145 in Chinese. Lu Xiao was interesting, good-looking, and was ranked first among the top students." Strategy for the Male God's Roll-Over Daily Life ";; Strategy for the Villain "; My Roommate Smells So Good ";," I Dream Every Day That My Opponent Is Touching Me ", and " Gentleman in School Uniform ".
<a href="/?from=ask_words" style="color:red" target="_blank">Read more exciting novels for free</a>
Is the idle wife of a powerful minister good-looking?As for whether " A Powerful Official's Wife " was good or not, this was a subjective judgment. Different readers had different reading preferences. However, its possible attractiveness could be considered from the following aspects.
From the setting of the story, the female protagonist Xie Anlan was originally a national security agent. When she woke up, she became the fourth young mistress of the Lu family in Quanzhou, Dongling. She faced a huge change in her identity. From a modern agent to an ancient young mistress, this kind of time-crossing setting added a lot of drama and conflict to the story. She had to deal with the weak husband of a concubine's son, the seemingly virtuous father-in-law who was actually a smiling tiger, the sisters-in-law and brothers with different thoughts, and many other complicated relationships. There was a lot of room for the plot to develop.
However, whether a book was good or not depended on one's preference for the ancient language, character creation, plot rhythm, and so on. If the readers liked Gu Yan's novels about politics, family relationships, and the story of the male and female protagonists supporting each other in a complicated environment, then " The Wife of a Powerful Official " might be more suitable for their tastes.
The original novel of the TV series " Record of Morning Snow " was Bu Yue Qian's " The Coroner of Power and Favor, Medical Concubine ". The original plot was equally exciting. You can click on the link below to read the original novel.