Assume I have a single mySQL table (users) with the following fields: I want to be able to return the number of total records based on the number a user enters. Furthermore, they will also be providing additional criteria. In the simplest example, they may ask for 1,000 records, where 600 records should have gender = ‘Male’ and 400 records
Tag: database
Modeling a prescription/medicine usage set of database tables
Not sure how to go about modelling medication taken at a point in time in a relational database. Each way I have thought of so far seems to have redundant data. Need to be able to have a user say I …
Incorrect syntax near the keyword ‘Table’ C# SQL [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 7 years ago. Improve this question Hello I’m trying to figure out why i have this error Incorrect syntax near the keyword ‘Table’. Thx in advance Code :
mySql database – ID auto_increment : what are the risks of it?
I´m kind of new to databases and I was hoping you could answer my question: I have a table with an ID that´s a primary key, not null and Auto increments. It´s data type is int, with a limit of 50 digits. this table will be receiving new rows constantly, so I was wondering if it´s dangerous to leave as
Bat File to Delete sql database
I am able to delete files/folders through the bat file fine, the problem comes when i need to delete old mdf and ldf files. I get access denied error message. Is there a way to overcome this in the …
The backend version is not supported to design database diagrams or tables
I’m trying to add a table to my newly created database through SQL Server Management Studio. However I get the error: the backend version is not supported to design database diagrams or tables To see my currently installed versions I clicked about in SSMS and this is what came up: What’s wrong here? Answer This is commonly reported as an
Deleting duplicate entries in table depends on several columns
I want to delete all duplicate entries in my MySQL database. I found a lot of solutions in the web but in every case the query worked only when you are looking up for 1 column. In my case I need a query for more than 1 row which will be executed as far as possible – the table is
SQL Server 2008 R2 Stuck in Single User Mode
Having executed a DB deploy (from a VS SQL Server database project) on a local database, which failed, the database has been left in a state where it has single user mode left on (the deploy runs as …
Best way to check for “empty or null value”
What is best way to check if value is null or empty string in Postgres sql statements? Value can be long expression so it is preferable that it is written only once in check. Currently I’m using: But it looks a bit ugly. stringexpression may be char(n) column or expression containing char(n) columns with trailing spaces. What is best way?
How to create copy of database using backup and restore
Using SQL Server Management Studio 2012, I’m trying to create a copy of a local database. I found a few variants of solution. One of them – backup and restore database as new one – HERE. Currently create database backup with name Rewards2_bak. This copy of file place in to system catalog C:Program FilesMicrosoft SQL ServerMSSQL11.MSSQLSERVERMSSQLBackup Next step – create