Databases

57K

Solutions

40K

Contributors

Databases are organized collections of data, most commonly accessed through management systems including schemas, tables, queries and processes that allow users to enter and manipulate the information or utilize it in other fashions, such as with web applications or for reporting purposes.

Share tech news, updates, or what's on your mind.

Sign up to Post

We are designing a mobile app that will have a question and answer section, very similar to EE as a matter of fact.

I need some help with the database design.

I had something like this in mind, please don't laugh:

Questions Table:

id | category_id | question_text | status_id | user_id | created_at | views |

Answers:

id | question_id | answer_text |user_id | created_at | status

Categories:

id | category_text | desc

Status:

id | status_text | desc

Users:

id | username | nickname

Of course the tables will have more fields, but that would be the general way I would do something like this.

My Problem:

The reason I am posting here is because the last time I showed a coworker my table design for a project similar to this, he damn near laughed. He explained to me somewhat, that I needed to use attributes and that by doing so all the related tables would be unnecessary.

But he didn't elaborate. Attributes? I think he meant like using JSON in the field values or something. At least, that's what I got out of his rambling.

So can someone show me a professional, clean, efficient, modern, and functional approach to the above table design? Can this be done by using JSON as data with field names, such as my coworker suggested ( again, I think ).

Thanks! Any example would help.

Regards,

John
0
Determine the Perfect Price for Your IT Services
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

I have a products and category collection. I want to query both of them and send the data through one controller so I can display products and categories in the same view.

This seems to work but I am not sure if it is the correct way of doing it? If not, please could you you advise me on a more appropriate way.

exports.getIndex = (req, res, next) => {
  Product.find({ status: "approved" })
    .sort({ createdAt: -1 })
    .then(products => {
      Category.find({})
        .sort({ catName: 1 })
        .then(category => {
          res.render("shop/index", {
            pageTitle: "My home page",
            path: "/",
            prods: products,
            category: category
          });
        });
    })
    .catch(err => {
      console.log(err);
    });
};

Open in new window

0
Database  Maintenance PlansHi,
 
 I have Microsoft SQL Server with 30GB of database and there are several DB Maintenance plans:
DB Maintenance Plan 1: It performs Optimization (runs 1am daily) and Integrity Checks (runs at 9:30pm daily).
DB Maintenance Plan 2: It backs up main SQL database to the shared folder off another PC on the network (runs at 10pm daily).
Transaction Log Backup: It backs up TRN files to the shared folder off another PC on the network every 30 minutes throughout the day.

1. What does Optimization and Integrity Checks?
2. Do they have to run Daily?
3. Between Database backup, Optimization and  Integrity Checks, what should be the right order of running these jobs as far as scheduling goes?
0
I have to remove over 800K records from a sql database, but would like to remove the records with a batch process of 5K to 10K at a time.

I've gathered my count using the query one below, and came up with the delete process in query two.

QUERY ONE:
WITH CTE AS (
    Select
        D_Item_GroupSK
    FROM
        DWH.F_Line_item_Shipment
    UNION ALL
       Select
        D_Item_GroupSK
    FROM
        DWH.F_Line_item_MBL
)
SELECt
    count(D.D_Item_GroupSK)
FROM
    DWH.D_Item_Group D LEFT OUTER JOIN
    CTE C ON D.D_Item_GroupSK = C.D_Item_GroupSK
WHERE
    C.D_Item_GroupSK IS NULL


Query two:
use [Datamart]
GO
DECLARE @batch INT
SET @batch = 10000
DECLARE @cnt INT
SET @cnt = 0
DECLARE @cntmax INT
SET @cntmax = 10
WHILE @cnt < @cntmax
BEGIN
  SET @cnt = @cnt + 1
  DELETE TOP(@batch) FROM DWH.F_Line_item_Shipment WHERE C.D_Item_GroupSK IS NULL
END
0
Somebody has a good example autocomplete search nodejs, express, mongodb
0
Anyone know of some modern contacts templates that Microsoft Access has?  

This particular one (shown below) was completely awful and hard to make changes to.
I succeeded but not satisfied with the end design at all.

https://support.office.com/en-gb/article/use-the-contacts-access-database-template-8b402426-db20-4a8f-ac4b-9031498c568e
0
mongodb SSL encryption with application makes slow.
Can somebody help on this
0
Is there any process to load jpeg images into oracle database using a procedure ? The database column will be a blob. I googled, but could not find any that I can use.
0
This is related to MySQL.
I ran a command --> mysqldump -u -p DBNAME > [Path of .sql file],
After running this command , I ran --> mysql -u -p DBNAME > [Path of .sql file].
After this, my Table data got overwritten and my Table is blank. Only the table structure remains. Please suggest how to bring back the Table original Data.
0
I'm creating an agencies document tracker database. I've already started the database which I've attached. But i want to format the database so that the DERA table will be the main table follow by the counties and agencies so that he can look like the second attachment.  Any assistance will be appreciated.
Agencies.accdb
Document.pdf
0
SolarWinds® VoIP and Network Quality Manager(VNQM)
SolarWinds® VoIP and Network Quality Manager(VNQM)

WAN and VoIP monitoring tools that can help with troubleshooting via an intuitive web interface. Review quality of service data, including jitter, latency, packet loss, and MOS. Troubleshoot call performance and correlate call issues with WAN performance for Cisco and Avaya calls

I have a bash shell script that I want to call a Oracle DB stored procedure with (procedure is in a package with public interface), I am running it on Cygwin:

#!/bin/bash

if [[ $1 = '' ]]; then

  echo
  echo "usage : copy_client_div.sh <master conect string> "
  exit 0
fi

test_db1=`$ORACLE_HOME/bin/sqlplus -s $1 << EOF
set heading off
set pages 0
set feedback off
select 999 from dual;

EOF`

test_db=`echo $test_db1`
echo test_db: ${test_db::-1}
echo ${test_db}


if [[ ${test_db::-1} != 999 ]]; then

  echo "Can NOT connect to database with the given connect string"
  echo
  exit 0

fi

CONNECT_STRING=$1

`$ORACLE_HOME/bin/sqlplus -s $CONNECT_STRING << EOF > /c/temp2/log.txt

set heading off
set pages 0
set feedback off

begin
      --GRANT EXECUTE ON COPY_STUDIES.ins_trial2 TO tsm10;
      execute PackageName.procedure_name(name=>'trialname',client_div_source=>'source1',client_div_target=>'target1',ftuser=>'user1');
      commit;
      exit;
end;
EOF
`

If I run the procedure by itself in a sql script, it works.  In the bash script, nothing happens and no error gets returned.  Can someone tell me what I am missing?  Thanks.
0
using microsoft visio 2013 standard how to draw various diagram like below
1. sequence diagrams
2. flow diagrams
3. activity diagram
4. user interaction diagrams
5. database diagrams
6. any other similar type of system, system flow diagrams

any good video tutorials, resources, , links around this?
please advise
0
I have a report from a database with 400 odd names
I would like to be able to email idividually all the people with the individual report, but do not know If it is possible, and if so, how to set this up

Gordon
0
Hi Experts,

I have a SQL view that is being linked to my Access app.
That view has a column named SNVNum, defined as follows
CAST(REPLACE(dbo.Skilled_Nursing_Visit_Note.SNV_ID, 'snv', '') AS int)

Open in new window

Now when I open the view and sort by that column it works perfectly fine in db container.
it also works fine when running the following in SSMS.
Select * from vw_SkilledVisitNotesFilterFrm Order by SNVNum

Open in new window

However when I assign the form the following SQL as record source.
        Me.RecordSource = "Select * from vw_SkilledVisitNotesFilterFrm  Order by SNVNum"

Open in new window

it gives me the error attached.
Untitled.png
0
hi am geting this error in database 12c in solaris i did this

Enter user-name: /as sysdba

Connected to an idle instance.

 

 

SQL> startup

ORA-00838: Specified value of MEMORY_TARGET is too small, needs to be at least 5243264M

SQL> create pfile from spfile;

 

 

File created.

 

 

SQL> startup

ORA-00838: Specified value of MEMORY_TARGET is too small, needs to be at least 5243264M

Open in new window

0
Need help in Implementing Skype for Business 2019.

I am in the process of Implementing Skype for Business 2019 in our company. We already have 2015 Skype for Business with 2 different pools as we have 2 sites(but in the same domain). However, one issue I currently have is that the CMS(Central Management Server) is still hosted on a Legacy Database(SQL 2008), it wasn't moved to the latest database back then. So, until the CMS is not moved to the compatible Server(which is minimum of 2012), the topology for 2019 will not publish as it keeps saying that there are legacy systems and the topology is unsupported .

I wanted to ask if I could create a new CMS with the already existing(old) CMS and parallelly run the new SFB 2109 Deployment? Or any other ideas if you people can help me with?

Thanks
0
I need to modify a Crystal report. Currently it shows a row for each entry in a table. I want to only show the first 5 rows, regardless of how many are in the table, as columns. Here is an example.

Current Result                              
                              
Record      Inspection Number      Inspection Value                  
1      20039      0.3                  
2      20039      0.4                  
3      20039      0.5                  
4      20039      0.3                  
5      20039      0.3                  
                              
                              
Desired Result                              
                              
Inspection Number      Inspection Value 1      Inspection Value 2      Inspection Value 3      Inspection Value 4      Inspection Value 5
20039                  0.3                  0.4                  0.5                  0.3                  0.3

I'm sorry that the columns don't line up but I'm sure you get the idea. How would I write this query and/or modify the report?

Thank you.
0
I'm getting the following error 7235 while starting backup service when discovering the solutions, find the KB for Error 7234/7235

Error: 7235, Severity: 17, State: 0  No other query entry found for the remote server SYBASESRV_BS - site SYB_BACKUP. Aborting this site handler, as no remote server responded. Please make sure the remote server is accepting connections.   

Open in new window


after issuing the following dump command line to Check that the remote server is up and running. I got the below error :

1> exec SYB_BACKUP...sp_who
2> go

If Backup Server is running, will get a meaningful response to this query. Unfourantly, we got the below error

Msg 7205, Level 17, State 2:
Line 1:
Can't open a connection to site 'SYB_BACKUP'.  See the error log file in the SQL

Server boot directory.
Msg 7205, Level 18, State 3:
Line 1:
Can't open a connection to site 'SYB_BACKUP'.  See the error log file in the SQL

Open in new window


as per the Action plan, we should check the interface file and I am not able to find the interface file yet. I would appreciate if anyone can share thoughts on this, please.
0
I have a Power Pivot Data Model that contains 17 tables from multiple databases.
Each table has multiple related and other formulas in them.

The current connection is no longer working. I need to create a new one.
Is it possible to create a new connection and move this Data Model in it's entirety to it?

The table properties does not allow me to change the connection name as shown in the attachment.
screen-shot-table-connection.docx
0
Rowby Goren Makes an Impact on Screen and Online
LVL 12
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

Is there a way to export all scripts from a Power Builder application using the IDE all at once to save time. If so how? Is there an external utility tool to do the same as well?
0
MySQL form POST to database.  When INSERT INTO query is performed on what seems are random basis (or perhaps it is based on content of the data POSTed from the text area on the from, the data saved to the field in the database sometimes has duplicate information.  For example, if there are multiple sentences, a portion of one of the sentences will be duplicated in the paragraph of text.  Not sure what would cause something like this.  When using the form we can edit and try to save the same text several times, usually it will eventually save correctly.  I have several other application/database pairs on the same web/mysql server and don't seem to experience this issue.  So I am assuming the problem is coming from this specific website.

Here are some code snippets:

from the PHP form:

<div id="workOrderForm">
                  
                                                   
                              <form name="workOrderForm" method="post"  action="formdata.php">
               
                                       <div class="formLable">Client Code:</div>
                                       <input name="clientCode" type="text" class="formFiller" onkeypress="return disableEnterKey(event)" option value="<?php echo $result['clientCode'];?> "  />
                                    
                                    <div id="emailLable">Email:</div>
                                       <input name="email" type="text" id="emailFiller" onkeypress="return disableEnterKey(event)" option value="<?php echo $result['email'];?>" />
                                                                        
                                    <div class="formLable">Company Name:</div>
                                       <input name="companyName" type="text" class="formFiller" onkeypress="return …
0
I'm going to be helping a non-profit youth organisation to modernise their IT systems, which includes moving their current 50,000-entry membership database (names/addresses/emails) from an old Access database into something that will simplify administration and enable concurrent use, etc, simplify mail merges and e-mail blasts etc. There are 150 staff, but whilst most of these will not need access to the member databases, I think we're still looking at around 25 staff who will, including the 4 IT staff.

Something that might help here is that they've recently been moved over to Office 365 (not sure which licence). There is an educational theme throughout the organisation's work, but I'm not sure whether they qualify for Education licenses. I will learn this at our first meeting.

The above does involve the personal details of children, so this will need to be a consideration.

Before the meeting, I just want to research a few options that might be available to them, therefore I would appreciate if you could suggest some options for what format their new database might take. The way I see it, here are some possible options...

# Putting them all as contacts in Office 365 (cut-down option for zero cost)
# Outlook Customer Manager (if they have Office 365 Business Premium)
# Getting something built in Microsoft Dynamic 365
# Buying an Azure SQL instance, and writing some sort of web-based front-end for it
# Buying a fully-featured cloud solution like …
0
hi am having this error when starting database
SQL> startup
ORACLE instance started.

Total System Global Area 1728053248 bytes
Fixed Size                  3004520 bytes
Variable Size            1056966552 bytes
Database Buffers          654311424 bytes
Redo Buffers               13770752 bytes
Database mounted.
ORA-01122: database file 1 failed verification check
ORA-01110: data file 1:
'/u01/app/oracle/oradata/dbname/datafile/o1_mf_system_fbj5km7b_.dbf'
ORA-01207: file is more recent than control file - old control file

Open in new window


the database is 12c in solaris
0
Access Database error... cannot open database.

Message says "The Microsoft Access Database Engine stopped the process because you and another user are attempting to change the same data at the same time"

I have searched for database lock file (*.dbl) but cannot find one. The backup file that we have available gives the same error.  Can someone please help?  Cannot repair because I cannot open the database.

Using Access 2007 (have tried to open a copy with Access 2016 but get the same message).
0
hi am in database 12c am having this error when starting my database in solaris

SQL> startup

ORACLE instance started.

 

 

Total System Global Area 1728053248 bytes

Fixed Size                  3004520 bytes

Variable Size            1023412120 bytes

Database Buffers          687865856 bytes

Redo Buffers               13770752 bytes

ORA-00205: error in identifying control file, check alert log for more info
0

Databases

57K

Solutions

40K

Contributors

Databases are organized collections of data, most commonly accessed through management systems including schemas, tables, queries and processes that allow users to enter and manipulate the information or utilize it in other fashions, such as with web applications or for reporting purposes.